PhpStorm没有在Xdebug的断点处停下来

时间:2018-03-19 18:10:41

标签: php phpstorm xdebug

我正在尝试使用Xdebug调试Yii2项目。

在格式化MacOS之前,我刚从浏览器进入了Web项目(Apache 2 Web服务器),PhpStorm在断点处自动停止。现在我已经设置了所有东西,但PhpStorm并没有停留在他们身上。

以下是调试器的PhpStorm验证:

enter image description here

这是CLI解释器(php 7.0可执行文件)

enter image description here

这是xdebug的IDE键:

enter image description here

我已经安装了Xdebug Chrome扩展程序,它处于调试模式。

我缺少什么? PhpStorm不会在断点处停下来的原因是什么?

2 个答案:

答案 0 :(得分:2)

由于XDebug在PHPSotmr配置中显示已加载,因此您的php.ini中已经有zend_extension = "/path/to/xdebug.so"

您可能没有php.ini中的其他必需设置。

检查php.ini中设置的以下值:

xdebug.remote_autostart=On
xdebug.remote_enable=On
xdebug.remote_handler=dbgp
xdebug.remote_port=9000

答案 1 :(得分:1)

  

在格式化MacOS之前,我刚从浏览器进入了Web项目(Apache 2 Web服务器),PhpStorm在断点处自动停止。现在我已经设置了所有东西,但PhpStorm并没有停留在他们身上。

您很可能安装了太多东西。我的意思是 - 你不知道或者它是如何工作的东西。

现在听起来它可能是 php-fpm - 它还使用Xdebug默认使用的TCP 9000端口...所以当Xdebug与IDE进行调试连接时而是连接到php-fpm(并且PhpStorm无法在Mac上检测到此类端口已在使用中)。

因此:请在php.ini和PhpStorm设置中将Xdebug端口更改为另一个数字(例如9001应该没问题。)