2

所以我试图让 sublime text 2 与 x-debug 一起运行我已经安装了

Kindari-SublimeXdebug

我有 wamp(我已启用 xdebug)这是 php.ini 配置

; XDEBUG Extension

zend_extension = 

"c:/wamp/bin/php/php5.3.10/zend_ext/php_xd

ebug-2.1.2-5.3-vc9-x86_64.dll"

[xdebug]
xdebug.remote_enable = On
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = On
xdebug.profiler_output_name = 

cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.remote_connect_back = On
xdebug.remote_autostart = On

但是每次我尝试通过 sublime 连接它时:

Xdebug : is not running

即使在我的 phpinfo() 中;它表明它可能运行..对不起,我还是 x-debug 和 sublime 的新手......提前谢谢

4

2 回答 2

2

我认为您需要将以下行添加到 xdebug 配置中php.ini

xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
于 2012-09-24T09:59:31.463 回答
1

尽管听起来您继续前进,但我会为遇到您问题的其他人添加此内容...

我也在运行 WAMP,让 Xdebug 与 Sublime Text 2 一起工作没有问题。确保遵循 Xdebug 的定制安装说明,它应该为你设置适当的 Xdebug DLL 和 php.ini 语句(确保你重新编辑正确的 php.ini!),相当于以下内容(与上面已经说过的 @Duke 和 @jasonmcclurg 非常匹配):

zend_extension = "D:\Program Files (x86)\Wamp\bin\php\php5.3.6\ext\php_xdebug-2.2.2-5.3-vc9.dll"

xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

您可以通过检查 的输出来检查 Xdebug 是否正确安装在本地服务器上phpinfo(),请参阅Xdebug 常见问题解答了解一些细节。

根据SublimeXdebug 的自述文件,在 Sublime 中使用Shift+F8并从出现的下拉菜单中选择 Start Debugger,然后在 PHP 代码中设置断点(将插入符号放在所需的 PHP 代码行上,按Shift+ F8,选择 Add/Remove Breakpoint)。

要触发远程调试(让 xdebug 连接),请将查询字符串附加?XDEBUG_SESSION_START=1到本地站点的 URL(例如,http://localhost/index.php?XDEBUG_SESSION_START=1)或使用为您执行等效操作的浏览器扩展程序/插件(例如,Chrome 的 xdebug_session 帮助程序,或者,这是什么我使用,简单的 Xdebug for Firefox)。另一种选择是让 SublimeXdebug 自动触发远程调试,有关详细信息,请参阅 SublimeXdebug 的自述文件。

一旦您的浏览器请求一个使用您的断点引用 PHP 文件的页面(并假设 PHP 解释器实际上到达带有您的断点的特定行,即您的脚本没有分支到其他地方,或者您的应用程序/CMS 没有返回缓存页面,可能会放弃执行您的脚本),执行应该在断点处停止......

如果一切设置正确但没有到达断点,SublimeXdebug 会在浏览器完成页面加载时在 Sublime 的状态栏上短暂显示“ Xdebug: Page finished execution. Reload to continue debugging. ”。

于 2013-04-06T18:42:53.267 回答