How to install PHP-FPM with Apache on Ubuntu 20.04

How to install PHP-FPM with Apache on Ubuntu 20.04

PHP FPM (FastCGI Process Manager) is an alternative to PHP-FastCGI implementation with some additional features, generally used for running heavy web applications.

1. Install Apache

Install Apache and FastCGI module.

2. Install PHP and PHP-FPM

Install PHP and PHP-FPM.

Check the status of the php-fpm service.

3. Configure Apache

Activate the required module.

Configure the virtual host to run PHP-FPM.

Add the below configuration between VirtualHost tag.

Restart Apache.

4. Testing

Create a PHP script that display PHP information.

Access http://localhost/info.php or http://serverIP/info.php. In the Server API the value is FPM/FastCGI.

PHP Information
PHP Information

2 Comments

  1. Hello, following your tutorial I end with an “Access denied.” message. I’m using ubuntu 20.04, Apache 2.4.41 and php7.4. Any ideas on how to solve it? Thank you in advance.

Leave a Reply

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