Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

WordPress PHP Fails After Ubuntu 18.04 Update

After you upgrade to 18.04 using the do-release-upgrade command your php (and WordPress) might not be working.

The Upgrade Procedure (16.04 to 18.04 Example)

We’ll assume that you first backed up your system, took a snapshot, etc and then did your basic system updates first:

$ sudo apt update
$ sudo apt upgrade
$ sudo apt dist-upgrade

Then you probably removed any unused packages:

$ sudo apt autoremove

Next you ran the do-release-upgrade command:

$ sudo do-release-upgrade

It will ask you to keep defaults and most users should probably do that instead of updating config files. Once all of that is done, you’ll reboot. That is when you will get this error:

Fixing the Error

$ sudo a2enmod php7.2

Next, restart apache.

$ systemctl restart apache2

Reload your page and WordPress should be working. The problem is that php7.0 doesn’t exist anymore after the upgrade so you need to tell apache to use php7.2.

Last updated on 3 Jan 2019
Published on 3 Jan 2019