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

mjs*_*mjs 6 php debugging netbeans 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
Run Code Online (Sandbox Code Playgroud)

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>
Run Code Online (Sandbox Code Playgroud)

但是,Xdebug仍然拒绝停止!

mjs*_*mjs 10

这似乎发生,如果你有已经加载的Xdebug作为extension(即extension=xdebug.so)在PHP配置,而不是zend_extension(即zend_extension=/usr/lib/php5/20060613+lfs/xdebug.so).

确保PHP配置中的任何地方都没有extension=xdebug.so,即使您非常确定自己正在使用它zend_extension.例如,如果你zend_extension/etc/php5/conf.d/xdebug.ini,这很可能是由一个取代extension/etc/php5/apache2/php.ini.如果是这种情况,没有任何人会抱怨,phpinfo()并将尽职尽责地报告Xdebug已加载!(Xdebug 2.1在phpinfo()作为扩展加载时会发出一个小警告,但以前的版本什么都不做.)