简体   繁体   English

Xdebug不在PHPStorm IDE中工作

[英]Xdebug not working in PHPStorm IDE

I am trying to setup xdebug in PHPStorm IDE and I followed the steps mentioned in one document 我正在尝试在PHPStorm IDE中设置xdebug,我按照一个文档中提到的步骤操作

I followed this document :" http://www.mysolutions.it/phpstorm-server-xdebug-configuration/ ". 我按照这个文件:“ http://www.mysolutions.it/phpstorm-server-xdebug-configuration/ ”。

But I am getting one error "Port 9000 is busy " and also if i run debug ,it is quitting.I will share my config settings 但我收到一个错误“端口9000正忙”,如果我运行调试,它将退出。我将分享我的配置设置

The steps I have done 我已经完成的步骤

In my Xdebug.ini 在我的Xdebug.ini中

zend_extension="/usr/lib/php5/20090626/xdebug.so"
xdebug.default_enable = 1
xdebug.idekey = "vagrant"
xdebug.remote_enable = 1
xdebug.remote_autostart = 0
xdebug.remote_port = 9000
xdebug.remote_handler=dbgp
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.remote_host="myip"

In PHP storm 在PHP风暴中

File->settings->PHPservers
Host : Ip for the virtual machine(Ip added in the host file)
Port:80
Debugger:Xdebugger

I checked the checkbox (Use PathMappings) 我选中了复选框(使用PathMappings)

Under that Project files (Absolute Path on the server : /var/www/myproj ) 在该项目文件下(服务器上的绝对路径: /var/www/myproj

File->settings->Deployment

Connection: 连接:

Type : FTP FTP Host :my virtual machine ip port :80 Root path: /var/www 键入:FTP FTP主机:我的虚拟机IP端口:80根路径: /var/www

Mappings: 映射:

Local Path: /Users/m1019238/dev/myproject/myproj 本地路径: /Users/m1019238/dev/myproject/myproj

Web Path on Server : /var/www/myproj 服务器上的Web路径: /var/www/myproj

I will share anything if i missed any settings that i have done other than this. 如果我错过了除此之外我做过的任何设置,我会分享任何内容。 Also very sorry for my english. 对我的英语也很抱歉。

我只是将“构建,执行,部署” - >“调试器”上的端口更改为9001之类的其他内容并将其更改回9000.这很奇怪,因为PhpStorm本身正在使用该端口。

For anyone else that may stumble upon this and don't want whack the entire config, you can find your PHPStorm configuration file path here: https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs 对于其他可能偶然发现并且不想敲击整个配置的人,您可以在此处找到您的PHPStorm配置文件路径: https ://intellij-support.jetbrains.com/hc/en-us/articles/206544519- 目录使用的由这-IDE到店的设置,高速缓存,插件和-日志

Once you locate the config folder, a text search for the used port should locate the file that configures PHP to automatically use the port (assuming phpstorm is the application listening on it). 找到配置文件夹后,对已使用端口的文本搜索应找到配置PHP以自动使用端口的文件(假设phpstorm是监听它的应用程序)。

For me on a mac, it was in ~/Library/Preferences/PhpStorm2017.1/options/other.xml 对于Mac上的我来说,它位于〜/ Library / Preferences / PhpStorm2017.1 / options / other.xml中

<application>
    <component name="BuiltInServerOptions" builtInServerPort="9000" builtInServerAvailableExternally="true" />
</application>

The built in server defaulted to 9000. Changing this to something else fixed things. 内置服务器默认为9000.将此更改为其他固定的东西。 Note that for my case, turns out I also could have changed the Build,Execution,Deployment > Debugger > Port option in the IDE itself. 请注意,对于我的情况,事实证明我也可以更改IDE本身的构建,执行,部署>调试器>端口选项。

I just figured what was my mistake: 我只知道我的错误是什么:

php-fpm was listening on 9000 so be sure you don't have php-fpm running and if so, you'll have to choose between changing your php-fpm port or your xdebug's one. php-fpm正在监听9000,所以请确保你没有运行php-fpm ,如果是这样,你必须在改变你的php-fpm端口或你的xdebug之间做出选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM