我安装了 Xdebug,一切正常,直到它突然停止工作。 phpinfo() 给出了一个包含所有变量的漂亮的 XDebug 输出。
php -m | grep deb
还给出了两次 XDebug(针对 Zend 和 PHP),所以看起来还是不错的。我的 php.ini 有这些行:
zend_extension=/usr/lib/php5/20090626/xdebug.so
;extension=xdebug.so
xdebug.remote_host=localhost
xdebug.remote_enable=on
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.remote_connect_back=1
然而,当使用 should check XDebug(来自 Netbeans 文档)运行此代码时,它只是卡住了。所以没有 IDE 与 XDebug 一起工作。
<?php
$address = '127.0.0.1';
$port = 9001;
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
socket_bind($sock, $address, $port) or die('Unable to bind');
socket_listen($sock);
$client = socket_accept($sock);
echo "connection established: $client";
socket_close($client);
socket_close($sock);
此外,根据 XDebug 安装,我完成了两次步骤。我的配置有什么问题?谢谢。
最佳答案
最后,只剩下两个解决方案 - 重新安装 Ubuntu 操作系统或安装一个新的 VM,特别是用于 xdebug,我选择第二个。 有趣的是,一切都按照“RTM”(f=freaking)进行。我无法弄清楚的一件事是如何阅读 XDebug 的日志以了解真正的问题出在哪里。
更新
经过一番努力,我从我拥有的每个 php.ini 中删除了与 xdebug 相关的每一行。并将这些行移动到/etc/php5/conf.d/xdebug.ini。重新启动 Apache,然后重新启动 PHPStorm,一切正常。 附言在中间,我尝试使用来自 github 的 pecl 和标准 Ubuntu 版本安装 xdebug。我认为我编译的那个目前正在工作。并且..日志也会更新。
;xdebug configuration
zend_extension = /usr/lib/php5/20090626/xdebug.so
xdebug.remote_host = 127.0.0.1
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=1
xdebug.remote_autostart=1
xdebug.idekey=PHPSTORM
xdebug.remote_log="/tmp/xdebug.log"
关于php - Xdebug 停止工作,我在哪里查找错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9964789/