Upgrade PHP from 7.0 to 7.4 — WordPress

WordPress kept telling me that my version of PHP was too old, so I upgraded. I basically followed this tutorial: Upgrade/Installation guide for PHP 7.4 on Ubuntu and Debian. Here is the summary:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.4

However, I ran into a couple of issues. First, Apache didn’t pick up the new version automatically (duh!). I fixed it by removing and disabling the old version(s) of PHP, and enabling the new version:

sudo apt-get remove php7.0
sudo a2dismod php7.0

sudo a2enmod php7.4
sudo systemctl restart apache2

I learned about a2endmod from this other tutorial Upgrade PHP version to PHP 7.4 on Ubuntu.

And that’s it, WordPress now says I’m doing a great job!

This entry was posted in Posts, SoftwareEngineering. Bookmark the permalink.