Eclipse 更新后无法调试 PHP Cli
今天我遇到了一个非常烦人的问题。有时我必须调试 php 命令行脚本,为此我使用 Eclipse PDT 和 Zend Debugger。虽然有问题,但它确实有效。直到我更新了 PDT,现在我的 cli 调试配置都不起作用(“PHP 网页”类型运行良好,只有 cli 错误)。如果我尝试启动一个,我会收到一条错误消息:
无法启动调试会话。 请确保调试器已正确配置为 php.ini 指令。
这非常有趣,因为 Eclipse 的更新是我所做的唯一更改。可能是什么问题?我在 Ubuntu 10.04 上使用 Eclipse Helios、PHP 5.3.2 和 Zend Debugger 5.2。
I came across a very annoying problem today. Sometimes I have to debug php command line scripts, for this I used Eclipse PDT with Zend Debugger. It was buggy, but it worked. Until I updated my PDT, and now none of my cli debug configurations work ('PHP Web Page' types do fine, only cli is wrong). If I try to start one, I get an error message:
The debug session could not be started.
Please make sure that the debugger is properly configured as a php.ini directive.
This is very interesting, since the update of Eclipse was the only change I made. What could be the problem? I'm using Eclipse Helios, PHP 5.3.2 with Zend Debugger 5.2 on Ubuntu 10.04.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚遇到了类似的问题,也是在仅更新 IDE (eclipse) 之后。
我认为这可能是一个错误。
我使用的是 xdebug 而不是 zend debug,并且 html 调试工作正常。
Cli 调试(无论你尝试什么方式,只是不调试)
从我所看到的,Cli 调试的调试指令没有加载正确的 php.ini 文件,并且默认为一些“普通的普通文件??” (这就是为什么它找不到你的 zend ini 指令)
我可以通过创建一个仅输出 phpinfo() 的简单 .php 文件来看到这种情况发生
当 cli 从 eclipse 运行(或调试)时,您会得到:(并且我在首选项中的“可选”php.ini 文件位置中有 /etc/php5/apache2/php.ini )
----- snip --- -
....
配置文件(php.ini)路径=> /etc/php5/cli
加载的配置文件=> /tmp/zend_debug/session1681149270511982227.tmp/php.ini
.....
----- snip ----
从实际命令行运行会给出: (ubuntu 10.10)
----- snip ----
....
配置文件(php.ini)路径=> /etc/php5/cli
加载的配置文件=> /etc/php5/cli/php.ini
.....
----- snip ----
如果您在 eclipse 中设置断点,并从 shell 启动脚本,断点就会激活(在我的例子中,它甚至运行到 zend_debug 文件夹,并且我使用的是 xdebug)
I just ran into a similar issue, also after only the IDE (eclipse) was updated.
I think this may be a bug.
I am using xdebug not zend debug, and html debugging is working fine.
Cli debug (any way you try, just does not debug)
From what I can see, the debug directives for Cli debugging is not loading the correct php.ini file, and defaulting to some 'plain vanilla file??' (hence why it does not find your zend ini directives)
I can see this happening by creating a simple .php file that just outputs phpinfo()
When the cli is run (or debug) from eclipse you get: (and I have /etc/php5/apache2/php.ini in my 'optional' php.ini file location in prefs)
----- snip ----
....
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /tmp/zend_debug/session1681149270511982227.tmp/php.ini
.....
----- snip ----
Running that from actual command line gives: (ubuntu 10.10)
----- snip ----
....
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
.....
----- snip ----
If you setup your breakpoints inside eclipse, and start the script from the shell, the breakpoints activate (in my case it even runs to a zend_debug folder, and I am using xdebug)