9 May, 2018 Tags: , , ,

Re-enabling PHP on Apache after updating to Ubuntu 18.05

So a few days ago, my ubuntu showed me a notification that a new version of my OS was available, yes, I am talking about Ubuntu 18.04 LTS, which is pretty good because of the Long Term Version part. Everything went fine except when I tried to access a wordpress website that I was working on. The browser would return all the php / html code instead of the rendered version. I’ve had this problem before, so a new that it was caused by the update of the new version of Ubuntu.

How I fixed

Well, first of all I had to make sure that the apache mod for php7.2, which is my current php version, was  installed. So typed this to install libapache2-mod-php7.2:

sudo apt-get install libapache2-mod-php7.2

Since I already had this mod installed, the terminal returned a message saying that the latest version of libapache2-mod-php7.2 was already on the computer. Well, with this information, all I had to to was to activate the mod:

sudo a2enmode php7.2

After this, I had everything running smoothly on my new Ubuntu.

OTHER ARTICLES