The fix

See code below

The story

Upgraded to Ubuntu 18 and the webserver broke. Something always breaks when you upgrade.

This time, it was my webserver… just like last time

All the packages were installed, but turns out, the Apache php7.2 module needed to be enabled.

sudo a2enmod php7.2

sudo systemctl restart apache2

Actually, I screwed up and tried to enable the older php7.1 packaged. So I did sudo a2dismod php7.1 to undo that and it worked fine.