3

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!

2
  • 1
    Doesn't work for me either. Eclipse PDT ships broken, as far as I can tell, and no one wants to admit it! Commented Mar 9, 2010 at 5:12
  • As far as I remember the console in Eclipse/PDT is broken. It omits many parts of the output and if you have just very less to output, nothing remains to display. Update: See bugs.eclipse.org/bugs/show_bug.cgi?id=282997 . I didnt found a solution either... Commented Apr 5, 2011 at 11:40

5 Answers 5

2

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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
?>

Comments

0

Other possibilities:

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

-check project specific settings

Comments

0

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.

Comments

0

try running as web page, since if you have php it implies you have apache, so eclipse will only open the url for you

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.