无法安装 php5-cli

无法安装 php5-cli
sudo 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
However the following packages replace it:
  php7.0-cli:i386 php7.0-cli

E: Package 'php5-cli' has no installation candidate

答案1

Ubuntu 16.04 附带 PHP 7.0,其软件包带有 php7.0- 前缀。PHP CLI SAPI 打包在 php7.0-cli 软件包中,并使用机制将/usr/bin/php命令符号链接到/usr/bin/php7.0二进制文件update-alternatives,以提供最佳可用 PHP 版本。

如果您需要 PHP 5.6 或 PHP 5.5 CLI,则需要使用ppa:ondrej/php并安装php5.6-cli或包。您可以使用或php5.5-cli访问 CLI 二进制文件,或者使用命令更新默认符号链接。/usr/bin/php5.6/usr/bin/php5.5/usr/bin/phpupdate-alternatives

相关内容