Would you like to learn how to install Apache and PHP-FPM? In this tutorial, we are going to configure the Apache server and enable the PHP support using PHP-FPM on a computer running Ubuntu Linux.

• Ubuntu 20
• Ubuntu 19
• Ubuntu 18
• Apache 2.4.41
• PHP 7.4.3

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Tutorial Apache – PHP-FPM installation

Install the Apache server.

Copy to Clipboard

Install the PHP-FPM package.

Copy to Clipboard

Enable the required Apache modules.

Copy to Clipboard

If you had PHP previously installed, you need to disable the standard PHP module.

Copy to Clipboard

Enable the MPM_EVENT feature.

Copy to Clipboard

Restart the PHP-FPM service.

Copy to Clipboard

Restart the Apache service.

Copy to Clipboard

In our example, the PHP-FPM version 7.4 was installed on the Apache server.

Create a file to test the PHP installation.

Copy to Clipboard

Here is the file content.

Copy to Clipboard

Open the browser and access the PHP test page.

In our example, the following URL was entered in the Browser:

• http://192.168.2.222/test.php

The Apache server will display the PHP information.

Apache - PHP-FPM

Congratulations! You installed Apache and PHP-FPM on Ubuntu Linux.