Install the Apache server.
Install the PHP-FPM package.
Enable the required Apache modules.
If you had PHP previously installed, you need to disable the standard PHP module.
Enable the MPM_EVENT feature.
Restart the PHP-FPM service.
Restart the Apache service.
In our example, the PHP-FPM version 7.4 was installed on the Apache server.
Create a file to test the PHP installation.
Here is the file content.
Open the browser and access the PHP test page.
In our example, the following URL was entered in the Browser:
The Apache server will display the PHP information.
Congratulations! You installed Apache and PHP-FPM on Ubuntu Linux.