将 XDebug 与 Eclipse PDT 结合使用XAMPP
我无法将 PHP 脚本作为脚本进行调试。它总是在启动后立即终止。我在 php.ini 中设置了 Xdebug 日志,但它完全没有帮助。 Xdebug 确实出现在我的 phpinfo() 上,所以我知道它已加载到 Apache 中。
我还可以将代码作为网页进行调试(它不提供有关变量的信息,并且不会在断点处停止),因此我知道 Eclipse 具有正确的服务器设置。两种调试选项都使用相同的 PHP exe(与 XAMPP 一起安装的,使用 vc6 编译器编译的 php 5.3.1)。我确保 Xdebug 的编译与这些设置相匹配。
可能相关的注释:我注意到我只能使用 zend_extension 命令加载 Xdebug,而不是 zend_extension_ts,即使我的 PHP 版本确实是线程安全的?我必须承认我对此有点困惑。
我还非常确定,只要我可以在 Eclipse 中选择“XDebug”,我就这么做了。我已经遵循了两个教程,但没有成功。有人有什么想法吗?我尝试了与我的 XAMPP (2.0.6-dev) 捆绑在一起的 Xdebug 版本,并且还下载了一个新的 .dll,版本 2.1。
谢谢!
I cannot debug a PHP script as a script. It always terminates immediately after starting. I set up an Xdebug log in my php.ini, but it's completely unhelpful. Xdebug does show up on my phpinfo(), so I know it's loaded in Apache.
I can also debug code as a webpage (which provides no info on variables and will not stop on breakpoints though), so I know Eclipse has the proper server settings. Both debug options use the same PHP exe (the one installed with XAMPP, php 5.3.1 compiled with vc6 compiler). I made sure that the compilation of Xdebug matched these settings.
On a perhaps related note: I noticed that I could only load Xdebug with the zend_extension command, instead of zend_extension_ts even though my version of PHP is indeed thread safe? I have to admit I'm a little confused by that.
I also made very sure that wherever I could select "XDebug" in Eclipse, I did. I've followed two tutorials to no avail here. Anyone have any ideas? I've tried the version of Xdebug bundled with my XAMPP (2.0.6-dev) and I also downloaded a new .dll, version 2.1.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 XAMPP 和 Eclipse 上设置 XDebug 的优秀说明
@user629300 说明适用于 3.5 之前的 eclipse 版本,请参阅链接以获取基于版本的说明的说明。另外 让 XDebug使用apache xampp调试php,有图片和很好的解释。不过它们有点陈旧。
第一个链接的详细信息摘要,假设 PHP > 5.3(希望每个人现在都在运行!):
确保您的 php.ini 文件包含以下内容:
<前><代码>[XDebug]
zend_extension={xampp-folder}\php\ext\php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_host =“本地主机”
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
[Zend]
标题下的所有配置条目,特别是那些以zend_extension
开头的条目现在,您应该能够通过将
XDEBUG_SESSION_START
添加到查询来在 Eclipse 中命中断点您的 URL 字符串,例如http://localhost/?XDEBUG_SESSION_START
。Excellent instructions for Setup XDebug on XAMPP and Eclipse
@user629300 Instructions are good for eclipse versions prior to 3.5 see the links to get instructions for version based instructions. Also Getting XDebug to work with apache xampp to debug php, has pictures with good explanations. They are a little stale though.
A summary of the details from the first link, assuming PHP > 5.3 (which hopefully everyone is running now!):
Make sure that your php.ini file contains the following:
[Zend]
heading, particularly those starting withzend_extension
You should now be able to hit breakpoints in Eclipse by adding
XDEBUG_SESSION_START
to the query string of your URL, e.g.http://localhost/?XDEBUG_SESSION_START
.首先下载xDebug的dll
然后编辑你的 php.ini 文件
zend_extension_ts = “C:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll”
确保该行未被注释
重新启动阿帕奇
确保您正在编辑正确的 php.ini 文件
first download the dll for xDebug
then edit your php.ini file
zend_extension_ts = “C:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll”
make sure the line is uncommented
restart apache
make sure you are editing the right php.ini file