PHP-FPM (FastCGI Process Manager) is an alternative to PHP FastCGI. It provides features like Adaptive process spawning, basic statistics, and advanced process management with graceful stop/start.

PHP 7.3 is not available for Debian Jessie so you will need to get it from a third party repository:

$sudo apt-get -y install apt-transport-https lsb-release ca-certificates 
$sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg 
$sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' 
$sudo apt-get update 

Next, run the commands below to install PHP 7.3 and related modules:

sudo apt install php7.3 php7.3-fpm php7.3-common

Open the PHP default config file for Apache 2.4 and make the following changes:

sudo nano /etc/php/7.3/fpm/php.ini
file_uploads = On 
allow_url_fopen = On 
memory_limit = 256M 
upload_max_filesize = 100M 
max_execution_time = 360 
; set timezone as needed
date.timezone = America/Los_Angeles

Run this command to enable FastCGI module for Apache 2.4:

sudo a2enmod actions fastcgi alias proxy_fcgi

Open your Apache default configuration file and add the following below the ErrorLog / CustomLog section:

<FilesMatch \.php$>
 SetHandler "proxy:unix:/run/php/php7.3-fpm.sock|fcgi://localhost/"
</FilesMatch>         

Restart Apache:

sudo systemctl restart apache2.service

Create a test.php file in your Apache root with this line:

<?php phpinfo( ); ?>

Browse to the file and your should see the PHP default test page. Verify it is showing PHP 7.3 with the Server API listed as: FPM/FastCGI

Leave a Reply

Your email address will not be published. Required fields are marked *