我正在尝试在本地使用 NetBeans Mac 进行调试。
这是我的 php.ini
[xdebug]
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_log="/Applications/MAMP/logs/xdebug.log"
xdebug.idekey="netbeans-xdebug"
zend_extension="/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
这就是我在 xdebug.log 中得到的内容
I: Connecting to configured address/port: localhost:9000.
E: Could not connect to client. :-(
我尝试将端口更改为 9001 并关闭防火墙,但没有帮助。
最佳答案
Xdebug 的默认端口 (9000) 与 FastCGI 冲突(Xdebug 是第一个!) - 解决方案是将其更改为另一个端口。完成后,您需要重新启动 IDE,您还需要在其中配置新端口。您还需要重新启动 PHP 和 Web 服务器。
关于php - XDebug 无法连接到客户端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17033605/