php - Xdebug成功连接到DBGP客户端,但不会在断点处停止

标签 php netbeans debugging breakpoints xdebug

我有Xdebug 2.1 安装,并运行 PHP 5.2.13。它可以成功连接到多个 DBGP 客户端(即 xdebug.remote_log 显示来回通信,客户端本身也显示传入连接),但它不会在断点处停止。我试过NetBeans , MacGDBp还有命令行 debugclient与 Xdebug 捆绑在一起。

一个典型的交换看起来像:

Log opened at 2010-07-20 09:33:17
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///mnt/hgfs/htdocs/mycompany/index.php" language="PHP" protocol_version="1.0" appid="14371" idekey="macgdbp"><engine version="2.1.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2010 by Derick Rethans]]></copyright></init>

<- status -i macgdbp
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="macgdbp" status="starting" reason="ok"></response>

<- step_into -i macgdbp
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="macgdbp" status="stopping" reason="ok"></response>

<- status -i macgdbp
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="macgdbp" status="stopping" reason="ok"></response>

Log closed at 2010-07-20 09:33:18

NetBeans 尝试设置断点,Xdebug 会确认这些断点:

<- breakpoint_set -i 7 -t line -s enabled -f file:///mnt/hgfs/htdocs/mycompany/index.php -n 9
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="7" state="enabled" id="139360004"></response>

但是,Xdebug 仍然不肯停止!

最佳答案

如果您在 PHP 配置中将 Xdebug 作为 extension(即 extension=xdebug.so)而不是 zend_extension< 加载,这似乎会发生(即 zend_extension=/usr/lib/php5/20060613+lfs/xdebug.so)。

请确保您的 PHP 配置中没有 extension=xdebug.soanywhere,即使您是很确定您正在使用 zend_extension。例如,如果您在 /etc/php5/conf.d/xdebug.ini 中有 zend_extension,这很可能会被 extension 取代在 /etc/php5/apache2/php.ini 中。如果是这种情况,则不会有任何提示,phpinfo() 会尽职尽责地报告 Xdebug 已加载! (当作为扩展加载时,Xdebug 2.1 确实会在 phpinfo() 中发出一个小警告,但之前的版本什么都不做。)

关于php - Xdebug成功连接到DBGP客户端,但不会在断点处停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3288840/

相关文章:

nginx 虚拟主机 : php5-fpm-sock error

php - 带有子菜单的菜单

java - 如何在计算中包括和排除复选框?集成开发环境

javascript - 打印出重复的数字

php - 我是在做梦还是回车会​​阻止 PHP 版本看到代码行?

php - 如何在 RESTful ZF2 应用程序中设计功能测试?

php - xdebug断点失败

javascript - 尽管出现成功消息,为什么用户输入不会进入数据库?

c - 在C中检查正在运行的进程的变量

java - 通过跳转主机远程调试eclipse