使用XDebug和Sublime Text进行流浪:不要在断点处停下来

时间:2013-09-25 13:03:14

标签: php laravel laravel-4 xdebug vagrant

我在使用Sublime Text 2,Vagrant和XDebug进行调试时遇到问题。调试不会在断点处停止

我使用这个流浪盒https://github.com/bryannielsen/Laravel4-Vagrant

我在StackOverflow中读过很多问题,没有人能解答我的问题。 Xdebug successfully connects to DBGP clients, but won't stop at breakpoints告诉我不要使用xdebug作为模块,我正在使用它作为扩展。好像还可以!其他人谈论php.ini配置,但我的日志似乎很好

当在sublimetext中启动xdebug时(使用https://github.com/Kindari/SublimeXdebug),它会正常启动网页,但是sublime会显示一条消息:等待执行而不是在断点处停止并且网页已满载

我的xdebug日志看起来很好

Log opened at 2013-09-25 12:01:56
I: Checking remote connect back address.
I: Remote address found, connecting to 10.0.2.2:9001.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/public/index.php" language="PHP" protocol_version="1.0" appid="14735" 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>

-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>

Log closed at 2013-09-25 12:01:56

Sublime text 2正在等待侦听端口9001,这是我的php.ini配置

xdebug.remote_enable=1
xdebug.remote_port=9001
xdebug.remote_autostart=0
xdebug.remote_connect_back=1
xdebug.remote_log=tmp/xdebug.log

有人有过这方面的经验吗?谢谢!

1 个答案:

答案 0 :(得分:0)

我从未在Sublime上使用它。 (实际上我在Google上搜索是否可能并登陆此页面:)

无论如何,我会尽力帮助你。我有一个与NetBeans类似的问题,我发现如果你没有指定远程主机,xDebug将不会回拨。这就是为什么NetBeans没有在任何断点停止的原因,它只是没有得到xDebug的任何响应。

尝试添加到php.ini:

xdebug.remote_host = 10.0.2.2

VM上的我的xdebug.ini如下所示:

xdebug.remote_enable = On
xdebug.remote_host = 10.0.2.2

P.S。还要确保在执行phpinfo()时填充这些设置。