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.