开发者

Eclipse PHP - Error trying to Run code

开发者 https://www.devze.com 2023-03-03 18:48 出处:网络
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.

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开发者_Python百科 Not Be Started, in order to generate debug information, please makw sure that the debugger is properly configured as a php.ini directive."


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消