Installer Apache 2 + PHP 7 + MariaDB sous Linux (LAMP)
Faire un update Aptitude
apt update
Faire un upgrade Aptitude
apt upgrade -y
Installer les composants requis
apt install ca-certificates apt-transport-https lsb-release gnupg curl nano unzip -y
Installer la clé de la nouvelle source :
wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add -
Ajouter la source dans le sources.list
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
Refaire un update Aptitude
apt update
Installer Apache 2
apt install apache2 -y
Installer PHP
apt install php7.4 php7.4-cli php7.4-curl php7.4-gd php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml php7.4-xsl php7.4-zip php7.4-bz2 libapache2-mod-php7.4 -y
Installer MariaDB (Mysql)
apt install mariadb-server mariadb-client -y
Sécuriser MariaDB
mysql_secure_installation
Activer les mods Apache
a2enmod rewrite
a2enmod Headers
a2enmod ssl
Redémarrer Apache
/etc/init.d/apache2 restart
Source : https://www.bennetrichter.de/en/tutorials/apache2-php7-mariadb-phpmyadmin/