Currently trying to configure a linode server running on ubuntu 10.04. I utilized a stackscript (Default drupal profile) which seemed to run successfully. The log indicate so as well.
Then ssh'd into the server (as root) to try to configure php.
When i run a which php
, which php5
they both return nothing. A which python
returns something though.
I know where the default path to php but i usually just like to use it as confirmation that php exists.
Do i have to modify some configurations to enable which
to work? Also tab completion doesn't seem to work for when i apt-get install?
Update:
Thanks for the suggestions guys. I've ran a couple commands and no luck either:
[ root@ ~ ]
$ dpkg -l |grep php
[ root@ ~ ]
$ apt-get install php5-cli
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php5-cli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package php5-cli has no installation candidate
Then i tried installing php and php cli:
[ root@ ~ ]
$ sudo apt-get install php5 php5-cli
sudo: unable to resolve host xxxxxxx
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package php5 has no installation candidate
This is the behaviour I would expect to see, and on a recently installed 10.04 I have to hand, is the behaviour I see:
From the which man page:
The most likely reason for this is that you do not have php installed, or at least, not within your $PATH.
Like I said in comments, there's a good chance PHP is simply not installed. There are two relevant packages: php5, and php5-cli. The latter lets you execute php files directly from command line:
I believe that PHP isn't installed at the moment on your Ubuntu box. There are 2 PHP packages to be installed - namely, php5 and php5-cli using the following commands (do not forget "sudo" in case you aren't root)
Additionally, consider installing other related packages that may be desired like libapache2-mod-php5 to integrate with Apache 2, and php-pear for PEAR.