views:

318

answers:

4

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!

A: 

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
?>
Sam Bisbee
A: 

Other possibilities:

-make sure the file has focus in the editor when 'run as'

-check project specific settings

koen
A: 

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.

FractalizeR
A: 

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.

Vadim Punski