linux: php Run PHP from the command line

As an alternative to /opt/lampp/bin/php, to run a php script from the command line, you just need to install php5-cli:

sudo apt-get install php5-cli

 

And run your script with:

php myscript.php

 

To open an interactive php shell, just type in a terminal:

If you want to write php directly in the terminal, you can use:

php -a

 

Reprinted from: linux: php Run PHP from the command line

 

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326854329&siteId=291194637