php 安装

 apt update -y

 apt-get install ca-certificates apt-transport-https software-properties-common -y

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

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

 apt-get udpate -y
 
 apt install php8.1-fpm -y


php扩展安装

 apt-get install php-bcmath 

 apt-get install php-bz2 

 apt-get install php-calendar 

 apt-get install php-ctype 

 apt-get install php-curl 

 apt-get install php-dom 

 apt-get install php-enchant 

 apt-get install php-exif 

 apt-get install php-fileinfo 

 apt-get install php-ftp 

 apt-get install php-gd 

 apt-get install php-gettext 

 apt-get install php-gmp 

 apt-get install php-iconv 

 apt-get install php-intl 

 apt-get install php-json 

 apt-get install php-ldap 

 apt-get install php-mbstring 

 apt-get install php-mysqli 

 apt-get install php-mysqlnd 

 apt-get install php-opcache 

 apt-get install php-pdo 

 apt-get install php-phar 

 apt-get install php-posix 

 apt-get install php-pspell 

 apt-get install php-readline 

 apt-get install php-shmop 

 apt-get install php-simplexml 

 apt-get install php-snmp 

 apt-get install php-soap 

 apt-get install php-sockets 

 apt-get install php-sqlite3 

 apt-get install php-sysvmsg 

 apt-get install php-sysvsem 

 apt-get install php-sysvshm 

 apt-get install php-wddx 

 apt-get install php-xml 

 apt-get install php-xsl

 apt-get install php-recode 

 apt-get install php-dba 

 apt-get install php-imap 

 apt-get install php-interbase 

 apt-get install php-odbc 

 apt-get install php-pgsql 

 apt-get install php-tidy 

 apt-get install php-zip

 

php查看已安装模块的命令:

php -m


一键安装脚本

curl -L https://cdn.0305.ink/debian/script/php_scchkj/php.sh | bash