Direkt zum Hauptinhalt

Install PHP

PHP Packete

#!/bin/bash
# add key and update apt list
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 update && apt-get upgrade -y
#Set php version
PHPVERSION=8.1
#Install
apt-get install -y php$PHPVERSION php$PHPVERSION-{bcmath,bz2,cgi,cli,common,curl,fpm,gd,gmp,imap,intl,json,mbstring,mysql,opcache,readline,soap,xml,xmlrpc,zip} libapache2-mod-php php$PHPVERSION-bcmath php$PHPVERSION-bz2 php$PHPVERSION-cgi php$PHPVERSION-cli php$PHPVERSION-common php$PHPVERSION-curl php$PHPVERSION-fpm php$PHPVERSION-gd php$PHPVERSION-gmp php$PHPVERSION-imap php$PHPVERSION-intl php$PHPVERSION-mbstring php$PHPVERSION-mysql php$PHPVERSION-opcache php$PHPVERSION-readline php$PHPVERSION-soap php$PHPVERSION-xml php$PHPVERSION-xmlrpc php$PHPVERSION-zip