PHP调试配置


PHP debugging configuration

当尝试在OS X上配置XAMPP中的XDebug以连接回PHPStorm时,在XDebug日志中收到以下消息,并且未能在PHPStorm的断点处停止。有什么建议,下一步要尝试什么吗?

Xdebug.log

Log opened at 2015-10-16 21:36:56
I: Checking remote connect back address.
I: Remote address found, connecting to ::1:9002.
I: Connected to client. 
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Applications/XAMPP/xamppfiles/htdocs/eatdata/app/php/crops/getCropTypes.php" language="PHP" protocol_version="1.0" appid="23586" idekey="PHPSTORM"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>
<- feature_set -i 1 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>
<- feature_set -i 2 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>
<- feature_set -i 3 -n max_children -v 100
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>
<- status -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="4" status="starting" reason="ok"></response>
<- step_into -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="5" status="stopping" reason="ok"></response>
<- breakpoint_set -i 6 -t line -f file:///Applications/XAMPP/xamppfiles/htdocs/eatdata/app/php/connect.php -n 71
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6"><error code="5"><message><![CDATA[command is not available]]></message></error></response>

相信这一行特别指出了问题,但不确定这条消息的确切含义。

<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6">
<error code="5">
<message><![CDATA[command is not available]]></message>
</error>
</response>

"命令不可用"行很可能是因为您在http://xdebug.org/dbgp/xdebug" fileuri="file:///Applications/XAMPP/xamppfiles/htdocs/eatdata/app/php/crops/getCropTypes.php的某个地方有拼写错误/语法错误-您可以运行php -l来查找它吗?

我还可以看到一个问题,因为文件名区分大小写。OS/PHP有时报告的文件大小写与编辑器期望的不同。我看到你使用的是2.2.5版本,因此我建议你至少升级到2.3.0,因为它已经修复了这个问题。