PHP Installieren
Zur Navigation springen
Zur Suche springen
Mithilfe dieses Scriptes können Sie auf einer Linux Distribution das PHP Packages installieren.
Schritt 1: Repository hinzufügen
sudo apt get update sudo apt get -y install apt-transport-https lsb-release ca-certificates curl sudo curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' sudo apt get update
Schritt 2: PHP Installieren
Nun hat man das Repository hinzugefügt und kann je nach gewünschter Version, php installieren.
z.B. für PHP 8.1
apt install php8.1-{common,curl,mysql,fpm,mbstring,dom,sqlite3,zip,cli,dev,readline,redis,bz2,bcmath,gd,imap,ps,xml}
oder für PHP 7.4
apt install php7.4-{common,curl,mysql,fpm,mbstring,dom,sqlite3,zip,cli,dev,readline,redis,bz2,bcmath,gd,imap,ps,xml}