WordPress Error 500 upgrading php 5.6 to 7.2

I recently performed a apt-get dist-upgrade to upgrade my php version.

Environment:

LAMP Server running wordpress.

Ubuntu 16.04

What happened

I upgraded my packages.

apt-get dist-upgrade

When checking wordpress from the dashboard, it still states that I am using php 5.6.

Checked the php version

php --version
PHP 7.2.3-1+ubuntu14.04.1+deb.sury.org+1

Checking what’s installed

dpkg -l | grep libapache2-mod-php
ii libapache2-mod-php5.6 5.6.34-1+ubuntu14.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii libapache2-mod-php7.2 7.2.3-1+ubuntu14.04.1+deb.sury.org+1 amd64 

Get rid of libapache2-mod-php5.6 5.6.34

apt-get remove --purge libapache2-mod-php5.6

Checked wordpress, it’s showing a error 500.

Forgot to enable php7.2

a2enmod php7.2

Restart apache.

service apache2 restart

We’re back in business. WordPress is back up. WordPress dashboard is showing PHP7.2

Leave a Reply