Eclipse PHP - 尝试运行代码时出错
错误 - 未定义 PHP 可执行文件
我正在 OS X 10.6 上使用 MAMP 1.9 运行 Eclipse
之前一切都工作正常。我创建了一个新的 PHP 文件,但现在我的文件都不会运行。
我重置了我的 Eclipse 首选项 - PHP 可执行文件,指向 MAMP/bin/PHP5.3/bin
然后我收到了一个 lauch 错误 - “会话无法启动,为了生成调试信息,请确保调试器已启动正确配置为 php.ini 指令。”
Error - No PHP Executables defined
I am running Eclipse on OS X 10.6 with MAMP 1.9
Everything was working fine before. I created a new PHP file and now none of my files will run.
I reset my Eclipse Preferences - PHP Executables, to point to MAMP/bin/PHP5.3/bin
Then I got a lauch error - "The Session Could Not Be Started, in order to generate debug information, please makw sure that the debugger is properly configured as a php.ini directive."
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
PHP 网页启动会在正在运行的服务器(通常是您的本地服务器)上打开一个 URL。
PHP 脚本启动使用您在首选项中定义的 CLI/CGI 可执行文件。
它还使用那里定义的 php.ini,据我所知,默认情况下它会尝试找到可执行文件旁边的那个。
听起来 php.ini 没有定义/定位。检查您选择的目录中是否有该 ini。
此 ini 还应该具有 CLI/CGI 调试会话所需的正确调试器指令和路径。
希望有帮助
A PHP Web Page launch opens a URL at a running server (usually your local server).
A PHP Script launch uses the CLI/CGI executable that you defined in your preferences.
It also uses the php.ini defined there, and from what I remember, it will try to locate the one next to the executable by default.
Sounds like the php.ini was not defined/located. Check that you have the ini in the directory you selected.
This ini should also have the right debugger directives and paths needed for the CLI/CGI debug session.
hope that helps
问题出在我的 MAMP php.ini ( /Applications/MAMP/conf/php5.3 ) 中。事实证明我需要删除“;” xdebug.so 路径行开头的分号。
错误:
[xdebug]
;zend_extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
正确:
[xdebug]
zend_extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
我的 MAMP php.ini 文件不包含 Zend 调试器的指令。上述设置适用于 MAMP PHP 5.3 php.ini 文件中的 XDebug。我的 php.ini 文件中没有任何有关 Zend 调试器的指令。一年多前,当我最初设置它时,我可能已经删除了它们,那么也许 Zend 调试器不包含在 MAMP 安装中。我欢迎对此进行确认,当然,如果有任何其他见解,我们将不胜感激。
我在下面提供了一些资源,供遇到 XDebug、Zend Debugger、MAMP 和 Eclipse PDT 设置和配置问题的人使用:
这是帮助我识别问题的线程,以及有关如何确认 Xdebug 正在运行的说明:
< a href="http://forum.mamp.info/viewtopic.php?f=6&t=9119&p=23143&hilit=eclipse+debug#p23143" rel="nofollow">http://forum. mamp.info/viewtopic.php?f=6&t=9119&p=23143&hilit=eclipse+debug#p23143
这是来自 NetBeans 支持,它是相关的,我认为对书签有一个很好的参考:
< a href="http://netbeans.org/kb/docs/php/configure-php-environment-mac-os.html" rel="nofollow">http://netbeans.org/kb/docs/php/ configure-php-environment-mac-os.html
我还发现 DeveloperWorks 中的此文档很有帮助,特别是第 17 - 21 页和第 30 页
PDF:
www.ibm.com/developerworks/opensource/tutorials/ os-php-eclipse-pdt-debug/os-php-eclipse-pdt-debug-pdf.pdf
URL:
www.ibm.com/developerworks/opensource/tutorials/os-php-eclipse-pdt-debug/section4.html
The problem was in my MAMP php.ini ( /Applications/MAMP/conf/php5.3 ). It turns out I needed to remove the ";" semi-colon from the beginning of the line with the path to xdebug.so.
Incorrect:
[xdebug]
;zend_extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
Correct:
[xdebug]
zend_extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
My MAMP php.ini file does not include a directive for the Zend Debugger. The above setting is for XDebug in the MAMP PHP 5.3 php.ini file. I did not have any directives for the Zend Debugger in my php.ini file. I may have removed them when I initially set this up over a year ago, then again maybe the Zend Debugger is not inlcuded with the MAMP installation. I would welcome confirmation on this and of course any additional insights are appreciated.
I have included some resources below for those experiencing problems with XDebug, Zend Debugger, MAMP, and Eclipse PDT setup and configuration:
This is the thread that helped me identify the problem, as well as instructions on how to confirm that Xdebug is running:
http://forum.mamp.info/viewtopic.php?f=6&t=9119&p=23143&hilit=eclipse+debug#p23143
This is from NetBeans Support, it is relevant and I think a good reference to bookmark:
http://netbeans.org/kb/docs/php/configure-php-environment-mac-os.html
I also found this documentation from DeveloperWorks to be helpful, particularly p.17 - 21 and p.30
PDF:
www.ibm.com/developerworks/opensource/tutorials/os-php-eclipse-pdt-debug/os-php-eclipse-pdt-debug-pdf.pdf
URL:
www.ibm.com/developerworks/opensource/tutorials/os-php-eclipse-pdt-debug/section4.html