Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xdebug在PHPStorm IDE中不工作_Php_Vagrant_Virtualbox - Fatal编程技术网

Xdebug在PHPStorm IDE中不工作

Xdebug在PHPStorm IDE中不工作,php,vagrant,virtualbox,Php,Vagrant,Virtualbox,我正在尝试在phpstormide中设置xdebug,并遵循了一个文档中提到的步骤 我遵循了这个文件:“ 但我收到一个错误“端口9000正忙”,并且如果我运行调试,它将退出。我将共享我的配置设置 我所做的步骤 在我的Xdebug.ini中 zend_extension="/usr/lib/php5/20090626/xdebug.so" xdebug.default_enable = 1 xdebug.idekey = "vagrant" xdebug.remote_enable = 1 xde

我正在尝试在phpstormide中设置xdebug,并遵循了一个文档中提到的步骤

我遵循了这个文件:“

但我收到一个错误“端口9000正忙”,并且如果我运行调试,它将退出。我将共享我的配置设置

我所做的步骤

在我的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"
在PHP风暴中

File->settings->PHPservers
Host : Ip for the virtual machine(Ip added in the host file)
Port:80
Debugger:Xdebugger
我选中了复选框(使用路径映射)

在该项目文件下(服务器上的绝对路径:
/var/www/myproj

连接:

类型:FTP主机:我的虚拟机ip端口:80根路径:
/var/www

映射:

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

File->settings->Deployment
服务器上的Web路径:
/var/www/myproj

File->settings->Deployment

如果我错过了除此之外所做的任何设置,我将分享任何内容。对于我的英语也很抱歉。

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

对于任何可能偶然发现此问题并且不想破坏整个配置的人,您可以在此处找到您的PhpStorm配置文件路径:

找到config文件夹后,对所用端口的文本搜索应找到将PHP配置为自动使用该端口的文件(假设phpstorm是侦听该端口的应用程序)

对我来说,在mac上,它位于~/Library/Preferences/PhpStorm2017.1/options/other.xml中

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


内置服务器默认为9000。将此更改为其他已修复的内容。请注意,就我的情况而言,事实证明我还可以更改IDE本身中的构建、执行、部署>调试器>端口选项。

我刚刚发现了我的错误:


php-fpm
正在侦听9000,因此请确保没有运行
php-fpm
,如果是,您必须在更改php-fpm端口或xdebug端口之间进行选择

端口9000正忙确保没有其他服务使用端口
9000
。在您的终端中键入此
netstat-plnt | grep':9000'
,检查端口900Hi@Rahil Wazir运行的应用程序,我尝试运行命令netstat-plnt | grep':9000'm,它在mac osx中不工作,请参见此处:尝试通过以下链接进行设置Hi我尝试了lsof-n-i4TCP:$port | grep LISTEN,它正在工作,我的端口正在侦听EclipseIDE.Hello。这实际上应该是一个评论,而不是一个答案。一旦你赢得足够的声誉,你就可以发表评论。干杯。不,这应该是答案。评论是要清理的…对我来说,这就是解决方案。这个解决方案对我也有帮助,你甚至可以将phpstorm端口留在9001上。