Ubuntu – PHP compiler/interpreter

compilerPHP

How to install PHP Compiler/Interpreter on ubuntu 11.04

I have latest version of PHP, but I want to learn PHP from terminal. Is there a PHP interpreter available that will run PHP programs inside terminal.

e.g. I want to run command like "phpc" or "phpi" or "php" to open up PHP REPL.

Thanks.

Best Answer

Just run

sudo apt-get install php5-cli

To run it in interactive mode:

php -a

Run a file:

php /path/to/file
Related Question