编程语言
首页 > 编程语言> > 在Debian 9中安装php5.6

在Debian 9中安装php5.6

作者:互联网

如何在Debian 9中安装php5.6

The following packages have unmet dependencies: libapache2-mod-php5 :
Depends: libdb5.1 but it is not installable Depends: libonig2 (>=
5.2.0) but it is not installable Depends: libssl1.0.0 (>= 1.0.1) but it is not installable Depends: apache2-mpm-prefork but it is not
installable or apache2-mpm-itk but it is not installable Depends:
php5-cli but it is not going to be installed E: Unable to correct
problems, you have held broken packages.

解决方法:

您可以使用OndřejSurý发布的软件包,请参阅deb.sury.org

打开终端并运行以下命令:

apt-get install apt-transport-https lsb-release ca-certificates

获取gpg密钥:

wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

要么:

curl https://packages.sury.org/php/apt.gpg | apt-key add -

将新存储库添加到源:

echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list

安装PHP5.6

apt-get update
apt-get install php5.6

要在PHP版本之间切换:

update-alternatives --config php

样本输出:

----------------------------------------------------------
* 0            /usr/bin/php7.0   70        mode automatique
  1            /usr/bin/php5.6   56        mode manuel
  2            /usr/bin/php7.0   70        mode manuel

标签:php,debian,php-5-6
来源: https://codeday.me/bug/20190926/1821081.html