这曾经是正常工作的,直到我转而使用MacPorts来安装Apache和PHP。我尝试过多次重新编译它(使用几个版本),但都没有成功。
我正在使用PHP 5.3.1和Xdebug 2.1.0-beta3
我还尝试了至少三个不同的调试程序(MacGDBp,Netbeans和JetBrains Web IDE)。
我的php.ini设置如下:
[xdebug]
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_host=localhost
xdebug.idekey=webide
当我记录调试器输出时,设置断点的代码如下:;
<- breakpoint_set -i 895 -t line -f file:///Users/WM_imac/Sites/wm/debug_test.php -n 13 -s enabled
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="895" state="enabled" id="890660002"></response>
运行调试器时,会获取应用程序第一行的上下文,然后发送分离和停止消息。但是,这行代码是在启动调试器时输出的。
<- feature_get -i 885 -n breakpoint_types
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="885" feature_name="breakpoint_types" supported="1"><![CDATA[line conditional call return exception]]></response>
“line conditional call return exception”代表什么意思?
/opt/local/etc/php5/php.ini
中使用ini文件(MacPorts安装的默认位置) - Bryan M.xdebug.remote_connect_back = 1
解决了我的问题;虽然这会让你的服务器对所有人开放进行调试,但当它是你本地机器上的虚拟机时,这没关系。我认为xdebug.remote_host =
是更具体限制到你的工作站上的关键。并且在更改设置时重新启动Apache... - Adrian