Ubuntu – How to Enable mod_php On Apache

apache-2.2PHPUbuntu

It seems that I cannot enable the mod_php on apache2 using the latest Ubuntu Server.

when I run: sudo a2enmod php5

I get this error: ERROR: Module php5 does not exist!

however I am convinced I have php installed correctly. I have even gone as far as uninstalling Apache and reinstalling.

Best Answer

Further research on my own question I was able to enable php by running:

sudo a2enmod php7.1

And then restarting Apache using:

sudo service apache2 restart

It looks like I was just trying to enable the incorrect mod.