Eclipse更新后无法调试PHP Cli [英] Can't debug PHP Cli after Eclipse update

查看:68
本文介绍了Eclipse更新后无法调试PHP Cli的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天遇到了一个非常烦人的问题.有时我必须调试php命令行脚本,为此我将Eclipse PDT与Zend Debugger一起使用.那是越野车,但是行得通.在我更新PDT之前,现在我的cli调试配置都无法正常工作("PHP Web Page"类型可以正常工作,只有cli是错误的).如果我尝试启动一个,则会收到错误消息:

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:

无法启动调试会话.请确保已将调试器正确配置为php.ini指令.

The debug session could not be started. Please make sure that the debugger is properly configured as a php.ini directive.

这非常有趣,因为Eclipse的更新是我所做的唯一更改.可能是什么问题呢?我在Ubuntu 10.04上使用 Eclipse Helios,PHP 5.3.2和Zend Debugger 5.2.

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.

推荐答案

在仅更新IDE(日食)之后,我也遇到了类似的问题.我认为这可能是一个错误.

I just ran into a similar issue, also after only the IDE (eclipse) was updated. I think this may be a bug.

我使用xdebug而不是zend debug,并且html调试正常.CLI调试(您尝试的任何方式,都不会调试)

I am using xdebug not zend debug, and html debugging is working fine. Cli debug (any way you try, just does not debug)

据我所知,用于Cli调试的调试指令未加载正确的php.ini文件,并且默认为某些普通香草文件"?(因此为什么找不到您的zend ini指令)

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)

通过创建一个仅输出phpinfo()的简单.php文件,我可以看到这种情况的发生从Eclipse运行cli时(或调试),您将得到:(并且我在prefs中的可选" php.ini文件位置中有/etc/php5/apache2/php.ini)

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 ---- ....

配置文件(php.ini)路径=>/etc/php5/cli加载的配置文件=>/tmp/zend_debug/session1681149270511982227.tmp/php.ini

Configuration File (php.ini) Path => /etc/php5/cli Loaded Configuration File => /tmp/zend_debug/session1681149270511982227.tmp/php.ini

...-----剪断----

..... ----- snip ----

从实际命令行运行该命令可获得:(ubuntu 10.10)

Running that from actual command line gives: (ubuntu 10.10)

-----剪断----....

----- snip ---- ....

配置文件(php.ini)路径=>/etc/php5/cli加载的配置文件=>/etc/php5/cli/php.ini

Configuration File (php.ini) Path => /etc/php5/cli Loaded Configuration File => /etc/php5/cli/php.ini

...-----剪断----

..... ----- snip ----

如果您在eclipse中设置断点,然后从shell启动脚本,则断点将被激活(在我的情况下,该断点甚至运行到zend_debug文件夹,而我正在使用xdebug)

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)

这篇关于Eclipse更新后无法调试PHP Cli的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆