There are two methods to running scripts from the command line whether its bash, perl, php etc. You need to either specify the required interpreter via the first line (shebang) or by running it directly:
user@computer$ php my_php_script.php
Add this as first line
to run directly
In the second case the file must have execute permissions set.
FYI php5-cli must be installed before you can run scripts from the command line. To run php from the webserver requires the proper apache modules and well as setting up the conf files. Ubuntu package manager makes this easy.
Last edited by michaelk; 11-07-2011 at 04:02 AM.