Posts: 29
Joined: Tue May 22, 2012 11:56 am

php -v not working

Tue Mar 12, 2013 10:48 am

I have installed php using sudo apt-get install php5

When I run php -v I get error message bash: php: command not found

Has my install run OK?

User avatar
Posts: 19490
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: php -v not working

Tue Mar 12, 2013 2:08 pm

You have installed PHP for a web server. That is fine if that is what you need to run.

If you want to be able to use PHP scripts from the command line, you need to install php5-cli. Then 'php -v' will work :)

Return to “Other programming languages”