- sudo apt update
- sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https
- sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
- wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
这里的https://packages.sury.org/php/apt.gpg key过期了, 需要执行
apt-key adv --fetch-keys 'https://packages.sury.org/php/apt.gpg' > /dev/null 2>&1
- rm /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
- vi /etc/ca-certificates.conf
- and remove
- mozilla/DST_Root_CA_X3.crt
- update-ca-certificates
apt install php5.6-fpm php7.3-fpm php7.4-fpm php7.4-mbstring php7.4-bz2 php7.4-bcmath php7.4-soap php7.4-gd php7.4-mysql php7.4-xmlrpc php7.4-dev php7.4-curl php7.4-xml php7.4-xsl php7.4-zip php7.4-gmp php7.4-cli php7.4-opcache php7.4-xhprof php7.3-mbstring php7.3-bz2 php7.3-bcmath php7.3-soap php7.3-gd php7.3-mysql php7.3-xmlrpc php7.3-dev php7.3-curl php7.3-xml php7.3-xsl php7.3-zip php7.3-fpm php7.3-gmp php7.3-cli php7.3-opcache php7.3-xhprof php5.6-fpm php5.6-xml php5.6-xmlrpc php5.6-curl php5.6-bz2 php5.6-bcmath php5.6-zip php5.6-xsl php5.6-mysql php5.6-dev php5.6-mbstring php5.6-soap php5.6-gd php5.6-gmp php5.6-cli php5.6-opcache php5.6-mcrypt php5.6-xhprof
apt install php8.0-fpm php8.0-mbstring php8.0-bz2 php8.0-bcmath php8.0-soap php8.0-gd php8.0-mysql php8.0-xmlrpc php8.0-dev php8.0-curl php8.0-xml php8.0-xsl php8.0-zip php8.0-gmp php8.0-cli php8.0-opcache php8.0-xhprof
apt install php8.3-fpm php8.3-xml php8.3-curl
安装composer
38 php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
39 php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
40 php composer-setup.php
41 php -r "unlink('composer-setup.php');"
42 mv composer.phar /usr/local/bin/composer
43 chmod +x /usr/local/bin/composer
composer config -g repo.packagist composer https://packagist.phpcomposer.com
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
参考:
How To Install PHP (8.2, 7.4 & 5.6) on Debian 11
Apt upgrade failed: GPG error packages.sury.org - #8 by eris - Hestia Control Panel - Discourse