Przygotowanie źródła
# apt install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2
# echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
# wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add - # apt update
Co zainstalowało się automatycznie
# apt install php8.1
# apt list php8.1* | grep -v dbgsym | grep installed
php8.1-cli/buster,now 8.1.2-1+0~20220127.12+debian10~1.gbpe46588 amd64 [installed,automatic] php8.1-common/buster,now 8.1.2-1+0~20220127.12+debian10~1.gbpe46588 amd64 [installed,automatic] php8.1-opcache/buster,now 8.1.2-1+0~20220127.12+debian10~1.gbpe46588 amd64 [installed,automatic] php8.1-readline/buster,now 8.1.2-1+0~20220127.12+debian10~1.gbpe46588 amd64 [installed,automatic] php8.1/buster,now 8.1.2-1+0~20220127.12+debian10~1.gbpe46588 all [installed]
Pakiety poprzedniej instalacji
# apt list php7.4-* | grep installed | grep -v dbgsym |grep -v automatic
php7.4-bcmath/stretch,now 7.4.27-1+0~20211220.57+debian9~1.gbp832572 amd64 [installed]
php7.4-bz2/stretch,now 7.4.27-1+0~20211220.57+debian9~1.gbp832572 amd64 [installed]
php7.4-curl/stretch,now 7.4.27-1+0~20211220.57+debian9~1.gbp832572 amd64 [installed]
php7.4-gd/stretch,now 7.4.27-1+0~20211220.57+debian9~1.gbp832572 amd64 [installed]
php7.4-intl/stretch,now 7.4.27-1+0~20211220.57+debian9~1.gbp832572 amd64 [installed]
php7.4-mbstring/stretch,now 7.4.27-1+0~20211220.57+debian9~1.gbp832572 amd64 [installed]
php7.4-mysql/stretch,now 7.4.27-1+0~20211220.57+debian9~1.gbp832572 amd64 [installed]
php7.4-soap/stretch,now 7.4.27-1+0~20211220.57+debian9~1.gbp832572 amd64 [installed]
php7.4-xml/stretch,now 7.4.27-1+0~20211220.57+debian9~1.gbp832572 amd64 [installed]
php7.4-zip/stretch,now 7.4.27-1+0~20211220.57+debian9~1.gbp832572 amd64 [installed]
Doinstalować potrzebne – brakujące pakiety
# apt install php8.1-curl php8.1-intl php8.1-mbstring php8.1-mysql php8.1-soap php8.1-xml php8.1-zip
# php -v
PHP 8.1.2 (cli) (built: Jan 27 2022 12:20:56) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.2, Copyright (c) Zend Technologies with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies
# php --modules