Reputation: 18526
I'm running eclipse galileo (5.5) with PDT 2.1.2. I have "PHP Executables" pointed to /usr/bin/php, which outputs:
$:/usr/bin$ php -version
PHP 5.2.6-3ubuntu4.2 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21 2009 19:14:44)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
I have created a new PHP project with a very basic php file named "newfile.php":
<?php
echo "Hello";
?>
When I right click the file and select "Run As->PHP Script", absolutely nothing happens! I expect the Console to gain focus and show my output, but . . . nothing! No output in the console, no error . . . nada.
I think I've got eclipse pointed to the correct php file. So, what am I doing wrong?
Any help is appreciated!
Upvotes: 3
Views: 5100
Reputation: 12140
try running as web page, since if you have php it implies you have apache, so eclipse will only open the url for you
Upvotes: 0
Reputation: 59
From you console, I see that you have php installed from Zend Engine product. You need to configure PHP executables in Window->Preferences->PHP->PHP Executables. Difine right path of php and php.ini files in the form.
Upvotes: 2
Reputation: 30013
Also try to right-click not a file in a file structure tree, but the very source code of this file and select the same.
Upvotes: 0
Reputation: 13767
Other possibilities:
-make sure the file has focus in the editor when 'run as'
-check project specific settings
Upvotes: 0
Reputation: 4441
This is a shot in the dark, but try putting the shebang line in at the top of your file. Proper shell scripting dictates that it needs to be there, and eclipse/pdt might care.
#!/usr/bin/php
<?php
//.....rest of your file
?>
Upvotes: 0