`哪个php不能在linode服务器(Ubuntu 10.04)上运行?

目前正在尝试configuration在Ubuntu 10.04上运行的linode服务器。 我使用了似乎能够成功运行的stackscript( 默认drupalconfiguration文件 )。 日志显示如此。

然后ssh进入服务器(作为根)来尝试configurationphp。

当我运行一个which php which php5他们都没有返回。 一个which python返回一些东西。

我知道哪里的默认path到PHP,但我通常只是喜欢用它作为确认PHP存在。

我必须修改一些configuration来启用which工作? 另外选项卡完成似乎不适用于当我apt-get安装?

更新:

感谢您的build议家伙。 我跑了几个命令,也没有运气:

 [ 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 

然后我尝试安装PHP和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 

这是我期望看到的行为,在我最近安装的10.04版本中,我看到的行为是:

 $ which python /usr/bin/python $ which php $ echo $? #prints exit status of most recent command 1 

从哪个手册页:

EXIT STATUS 0如果find并执行所有指定的命令

  1 if one or more specified commands is nonexistent or not executable 2 if an invalid option is specified 

最可能的原因是你没有安装php,或者至less不在你的$ PATH中。

就像我在评论中所说,没有安装PHP是一个很好的机会。 有两个相关的软件包:php5和php5-cli。 后者让你直接从命令行执行php文件:

 platinum:~# apt-get remove php5-cli platinum:~# which php platinum:~# platinum:~# apt-get install php5-cli platinum:~# which php /usr/bin/php platinum:~# 

我相信,在你的Ubuntu盒子上目前还没有安装PHP。 有2个PHP软件包需要安装,即使用以下命令(如果你不是root的话,不要忘了“sudo”),即php5和php5-cli。

 sudo apt-get install php5 sudo apt-get install php5-cli 

另外,考虑安装其他相关的软件包,比如libapache2-mod-php5与Apache2集成,以及用于PEAR的php-pear。

 sudo apt-get install libapache2-mod-php5 php-pear