RUN as PHP CLI [message #1717337] |
Fri, 11 December 2015 21:10  |
Eclipse User |
|
|
|
Eclipse and PDT installed
PHP installed
PHP executable path set up in eclipse (c:\php)
Just want to run simple hello world scirpt without setting up web server.
When I Run As - PHP CLI application nothing happens.
I would expect it to do like java and find the php.exe and spit the output into the console. I can run the script from the command prompt c:\php\php.exe helloworld.php fine. Can't I do this in eclipse?
Why is this so hard?
Thanks
|
|
|
|
Re: RUN as PHP CLI [message #1717551 is a reply to message #1717513] |
Mon, 14 December 2015 16:35   |
Eclipse User |
|
|
|
If you go into Windows->Preferences->PHP->PHP Executables, do you have a PHP Executable set up? If not, add one there and then it should work. Good luck.
|
|
|
Re: RUN as PHP CLI [message #1720820 is a reply to message #1717551] |
Thu, 21 January 2016 09:25   |
Eclipse User |
|
|
|
look for lines that starts with LoadModule php... There propably is configuration files/directories named mods or something like that, start from there.
You could also check output from php -r 'phpinfo();' | grep php and compare lines to phpinfo(); from web server.
To run php interactively
so you can paste/write code to console run it with:
php -a
To make it parse file and output to console:
php -f file.php
Parse file and output to another file:
php -f file.php > reults.html
|
|
|
|
Re: RUN as PHP CLI [message #1723949 is a reply to message #1723833] |
Fri, 19 February 2016 08:28  |
Eclipse User |
|
|
|
It's worth adding that PHP from version 5.4 onwards is able to run a web server on its own. You can do it by running this code in a folder which you want to serve the pages from:
$ php -S localhost:8000
|
|
|
Powered by
FUDForum. Page generated in 0.04364 seconds