【发布时间】:2020-04-09 09:43:28
【问题描述】:
我有一个运行 Apache 和 PHP7 的 Ubuntu 服务器,安装了 Xdebug 并在 phpinfo() 中确认:
xdebug
xdebug support enabled
Version 2.6.0
IDE Key PHPSTORM
我的 PhpStorm 在 Mac 上运行,另一台机器。网络服务器正在正常运行。如果我从 PhpStorm 调试 PHP 脚本也可以正常工作。但是,如果我在 PhpStorm 中的代码中添加断点并从 Web 浏览器运行 PHP,则调试器似乎不会执行任何操作。我的代码只是执行。 PhpStorm 不会在我设置的断点处开始调试。
如果我故意将错误添加到我的 PHP 代码中,我可以通过输出看到 Xdebug 正在服务器上执行某些操作,则错误会显示在 xdebug-error 表中。
在 Ubuntu 服务器上正确的 PHP.ini 中,我设置了正确的设置:
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_host=192.168.0.130
所以:
- PhpStorm 正在侦听 PHP 调试连接,或者至少启用了“侦听调试连接”
- 两者都配置为监听/与端口 9000 对话
- CLI 解释器已正确设置为远程 Ubuntu 服务器
- 路径映射正确(在我的例子中:
/volumes/internet->/var/www) - [编辑] 9000 上的端口扫描在 PhpStorm 正在侦听时显示 cslistener,当关闭时那里什么都没有
我想让我的断点工作,我做错了什么?
【问题讨论】:
-
关闭 PhpStorm 并检查端口 9000 上是否有任何东西在运行。如果有任何东西(如 php-fpm) - 将 XDebug 端口更改为 9001。
-
@Ástþór,谢谢。试过了,但似乎 9000 端口没有被其他任何东西使用