I have just started Eclipse for developing PHP. I did the first project in the book and it went great with a bit of help from you all.
Then I opened a second project. While trying to configure the run path (Eclipse always starts out pointing to my server's root), Somehow I got the IDE in a state that I can't get it out of. It pops up a dialog box when I try to run the project with the title "launch error" and in the box it says: "Please set a valid PHP executable for this launch". I think it has something to do with the debugger which I am not using yet. My code is very simple, in file one:
<?php
include('helloObj.php');
$hello= new hello();
$hello->prntMessage();
?>
And in file two:
<?php
class Hello {
var $message;
function __construct() {
$this->message= "Hello World!";
}
/**
* Function that prints the value of the instance variable
* $message
*/
function prntMessage() {
echo $this->message;
}
}
?>
This was copied off a tutorial on the web (and works just fine in my browser) so I don't think it is the cause.
Also, if someone could tell me the recommended way to configure PHP run paths in Eclipse, I would appreciate that too.
Do the following:
Run -> Debug Configurations
Chose your PHP Debugger. I chose XDebug
Find your PHP executable (php.exe
). In XAMPP it is at C:\xampp\php\php.exe
Point to your PHP file.
Press debug at bottom.
The script should run.