Funwinn 发布的文章

apt -y install apt-transport-https lsb-release ca-certificates curl
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
apt update
apt install php5.6   [PHP 5.6]
apt install php7.0   [PHP 7.0]
apt install php7.1   [PHP 7.1]
apt install php7.2   [PHP 7.2]
apt install php7.3   [PHP 7.3]
apt install php7.4   [PHP 8.0]
apt install php8.1   [PHP 8.1]

指定默认版本

update-alternatives --set php /usr/bin/php5.6