Why doesn't eclipse run my php file?

I am running eclipse galileo (5.5) with PDT 2.1.2. I have "PHP executables" pointing 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 created a new PHP project with a very simple php file called "newfile.php":

<?php
echo "Hello";
?>

When I right-click a file and select "Run As-> PHP Script", absolutely nothing happens! I expect the console to get focus and show my result, but ... nothing! There is no output in the console, no errors., Nada.

I think my eclipse is pointing to the correct php file. So what am I doing wrong?

Any help is appreciated!

+3
source share
5 answers

, , php Zend Engine. PHP Window- > Preferences- > PHP- > PHP Executables. Difine php php.ini .

+2

, shebang . , , eclipse/pdt .

#!/usr/bin/php
<?php
//.....rest of your file
?>
0

:

- , ,

-

0

, .

0

try launching the webpage as if you have php it means you have apache so eclipse will only open the url for you

0
source

Source: https://habr.com/ru/post/1717675/


All Articles