【发布时间】:2010-03-01 22:50:33
【问题描述】:
我在使用远程调试时遇到 xdebug 没有在断点处停止的问题(通过命令行运行脚本时一切正常)。它将在程序的第一行中断,然后退出,不捕获任何断点。
它曾经工作得很好,直到我转而使用 MacPorts for Apache 和 PHP。我已经尝试过多次重新编译它(有几个版本),但没有骰子。
我正在使用 PHP 5.3.1 和 Xdebug 2.1.0-beta3
我还尝试了至少 3 种不同的调试程序(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>
“行条件调用返回异常”是否意味着什么?
【问题讨论】:
-
进一步研究表明,“行条件调用返回异常”是支持的断点列表,而不是任何类型的错误消息。
-
调用 xdebug_break();在我的代码中将正确地导致调试器停止。
-
你能指定你的 php.ini 文件的路径吗?您是否为此主机使用 HTTPS?
-
使用常规 http,ini 文件位于
/opt/local/etc/php5/php.ini(MacPorts 安装的默认位置) -
在遇到这个问题很长一段时间后,它似乎已通过以下方式解决:a) 从 Leopard 升级到 Snow Leopard(在 OS X 中重新安装了大部分 unix 系统)和 b) 完全重新通过 MacPorts 安装我的开发环境。