我已经在我的 64 位 Win7 机器上成功安装了 Sublime Text 和 xdebug,并在 Firefox 中安装了最简单的 Xdebug插件。Sublime Text 以管理员身份运行,它的项目文件设置了正确的路径和 xdebug 设置,我只在具有有效 PHP 代码的行上设置断点。WampServer 在http://localhost:8080/
.
xdebug 包命令似乎按设计工作,但调试器永远不会在我的断点处停止。在 Sublime Text 中启动或停止调试器会在 Firefox 中打开正确的 HTML 页面,尽管页面加载速度比平时慢得多。
我已经设置了 xdebug 日志。这是一个示例。
Log opened at 2013-06-23 21:42:02
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///C:/wamp/bin/php/firelogger/firelogger.php" language="PHP" protocol_version="1.0" appid="3948" idekey="sublime.xdebug"><engine version="2.2.3"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2013 by Derick Rethans]]></copyright></init>
<- breakpoint_set -i 1 -n 10 -t line -f file://C:\Users\work\My Projects\ElseApps\EAFF\code\webroot\index.php
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1"><error code="1"><message><![CDATA[parse error in command]]></message></error></response>
<- breakpoint_set -i 2 -n 17 -t line -f file://C:\Users\work\My Projects\ElseApps\EAFF\code\approot\core\etc\eaff-index.php
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2"><error code="1"><message><![CDATA[parse error in command]]></message></error></response>
<- breakpoint_set -i 3 -n 18 -t line -f file://C:\Users\work\My Projects\ElseApps\EAFF\code\approot\core\etc\eaff-index.php
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="3"><error code="1"><message><![CDATA[parse error in command]]></message></error></response>
<- run -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="4" status="stopping" reason="ok"></response>
Log closed at 2013-06-23 21:42:04
为了完整起见,这是我的 php.ini 文件的 xdebug 部分...
[xdebug]
zend_extension = c:\wamp\bin\php\php5.3.13\ext\php_xdebug-2.2.3-5.3-vc9-x86_64.dll
;xdebug.remote_enable = off
;xdebug.profiler_enable = off
;xdebug.profiler_enable_trigger = off
;xdebug.profiler_output_name = cachegrind.out.%t.%p
;xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_log=C:\wamp\bin\apache\apache2.2.22\logs\xdebug.log
xdebug.remote_mode=req
xdebug.profiler_enable=1
xdebug.profiler_output_dir="c:/wamp/tmp/"
xdebug.collect_params=On
xdebug.show_local_vars=On
...和 Sublime Text 项目文件。
{
"folders":
[
{
"path": "/C/Users/work/My Projects/ElseApps/EAFF/code"
}
],
"settings": {
"xdebug": { "url": "http://localhost:8080" }
}
单击开始调试后,Sublime Text 的状态栏显示以下消息,并且页面加载缓慢:
Xdebug: Page finished executing. Reload to continue debugging.
谁能发现我哪里出错了,或者建议一个有用的方法来诊断问题?