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