Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
deb13:apache [2026/05/18 15:50] – [PHP Installation] Bernard Condraudeb13:apache [2026/05/18 23:00] (current) – [Apache 2.4 and PHP 8.4] Bernard Condrau
Line 1: Line 1:
-====== Apache 2.4 and PHP 8 ======+====== Apache 2.4 and PHP 8.4 ====== 
 +add the following:<code>RequestHeader set X-Forwarded-Proto "https" env=HTTPS 
 +SetEnvIfNoCase X-Forwarded-Proto https HTTPS=on</code>
 ===== Apache 2.4 Installation ===== ===== Apache 2.4 Installation =====
   - Install apache 2.4<code>$ sudo apt update   - Install apache 2.4<code>$ sudo apt update
Line 9: Line 11:
   - Install and configure [[deb11:certbot|Let's Encrypt Certbot]]   - Install and configure [[deb11:certbot|Let's Encrypt Certbot]]
   - If you are migrating from an old server, follow the [[deb11:migrate#apache_2.4|How to migrate a (web) server]] guide   - If you are migrating from an old server, follow the [[deb11:migrate#apache_2.4|How to migrate a (web) server]] guide
 +  - Run ''apachectl configtest'' before reloading apache
 ===== Apache Settings ===== ===== Apache Settings =====
  
Line 28: Line 30:
 ===== PHP Installation ===== ===== PHP Installation =====
   - Download the GPG key:<code>$ sudo apt update   - Download the GPG key:<code>$ sudo apt update
-curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg</code>+curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg</code> 
 +  - Add the repository to your sources<code>$ echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list</code> 
 +  - Install the desired PHP version, where V is the major and v is the minor version number, for example 8.4<code>$ sudo apt update 
 +$ sudo apt install php8.4</code>
  
-  - Add the SURY repository to your system<code>$ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list</code> 
-  - Import the repository key<code>$ wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -</code> 
-  - Install the desired PHP version, where V is the major and v is the minor version number, for example 7.4 or 8.1<code>$ sudo apt update 
-$ sudo apt install phpV.v</code> 
   - Enable modules:<code>$ sudo a2enmod ssl   - Enable modules:<code>$ sudo a2enmod ssl
 $ sudo a2enmod proxy $ sudo a2enmod proxy