Install php5.6 in Debian 9

筅森魡賤 提交于 2019-11-27 18:00:01

You can use the packages released by Ondřej Surý , see deb.sury.org

Open the terminal and run the following command:

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

Get the gpg key:

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

or:

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

Add the new repository to your sources:

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

Install PHP5.6

apt-get update
apt-get install php5.6

To switch between PHP versions:

update-alternatives --config php

Sample output:

----------------------------------------------------------
* 0            /usr/bin/php7.0   70        mode automatique
  1            /usr/bin/php5.6   56        mode manuel
  2            /usr/bin/php7.0   70        mode manuel
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!