【发布时间】:2010-12-24 12:35:05
【问题描述】:
一年多来,我一直在将 eclipse-pdt 与 xdebug 和 apache 结合使用,没有出现任何问题。一切都完美无缺,我可以在 eclipse 中进行所有我想要的交互式调试(使用我自己的机器作为服务器)。
现在我从 apache 切换到 nginx(因此 PHP 现在不是作为 Apache 服务运行,而是作为 fast-cgi 运行),我找不到配置 eclipse 以与 xdebug 很好地配合使用的方法.我不确定问题出在 xdebug 还是 eclipse(或两者)上。
在eclipse配置中我已经将PHP配置文件的引用改为/etc/php5/cli/php.ini。
尝试使用 php.ini 版本 1
带有以下php.ini文件
zend_extension=/usr/lib/php5/20060613/xdebug.so
- 我看到 xdebug 正在运行(例如,如果我执行
var_dump(),我会得到它的 xdebug 版本,而不是普通的 PHP 版本) - 我无法从 Eclipse 进行交互式调试:浏览器打开并使用包含
...?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=...的典型 URL 完全加载页面,但程序执行不会在断点处停止 - 在 Eclipse 的右下角,我看到一条可疑消息:"Launching =put_the_name_of_my_project_here=: 57%" 与 "refreshing workspace" 交替出现。
尝试使用 php.ini 版本 2
如果我使用该文件的其他版本(在我切换到 nginx 之前它一直有效):
zend_extension=/usr/lib/php5/20060613/xdebug.so
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_mode=req
我根本无法访问我网站的任何页面。
PS:我机器上的其他数据: - 操作系统: GNU/Linux - Ubuntu 9.10 64 位。 - PHP: 5.2.10-2ubuntu6.3 和 Suhosin-Patch 0.9.7; Zend Engine v2.2.0,版权所有 (c) 1998-2009 Zend Technologies with Xdebug v2.0.4 - Eclipse:看截图。
【问题讨论】:
标签: php eclipse fastcgi xdebug eclipse-pdt