参考:https://idroot.us/install-php-7-4-debian-10/
1. 安装前升级系统:
sudo apt update
sudo apt upgrade
2. 在Debian 10.7安装PHP 7.4:
apt -y install lsb-release apt-transport-https ca-certificates wget
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
添加仓库:
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
apt update
apt search php7.4
apt install php7.4
apt install php7.4-{fpm,cli,gd,bcmath,common,xml,xmlrpc,intl,soap,mbstring,mysql,ldap,opcache,bz2,zip}
apt search php8.0:
apt install php8.0
apt install php8.0-{fpm,cli,gd,bcmath,common,xml,xmlrpc,intl,soap,mbstring,mysql,ldap,opcache,bz2,zip}
3. 执行php脚本:
来源:oschina
链接:https://my.oschina.net/michaelshu/blog/4874469