Install mod_php on Apache

Install mod_php on Apache. Required if you need to run PHP applications on Apache. To run PHP on Apache, you also need to PHP installation.

sudo apt install -y libapache2-mod-php

After installing mod_php, it's time to enable mod_php. (Listed June 8, 2020. Ubuntu 18. PHP version 7.2)

sudo a2enmod php7.2

Finally, restart Apache with the systemctl command and you're done.

sudo systemctl reload apache2

Your PHP application is now running on Apache.

Associated Information