This blog has been a bit neglected for the last few years. I miss the opportunity to reflect on something I’ve done and write up those thoughts. We’ll see whether this is a one-off or the start of something new!
The first task was to make sure everything on the site was up-to-date. WordPress does a pretty good job of automatically applying security fixes but the Ubuntu VPS needed an upgrade. The update to Jammy went smoothly enough but attempting to access the site showed the WordPress PHP source. The enabled modules for Apache showed a couple of broken symlinks to PHP 7. After enabling those for PHP 8.1, I saw a WordPress error page: There has been a critical error on this website
.
The WordPress PHP compatibility matrix indicates that there are still exceptions with PHP 8 versions. Time to get PHP 7 back…
1 2 3 4 5 6 |
sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt install php7.4 sudo apt install php7.4-common php7.4-mysql php7.4-xml \ php7.4-json php7.4-mbstring php7.4-gd php7.4-curl sudo update-alternatives --config php |
Then re-enable the PHP 7 Apache modules:
1 2 3 |
sudo a2dismod php8.3 sudo a2enmod php7.4 sudo apachectl restart |
With the site rendering again, I thought I was done but on posting this entry the dreaded critical error reappeared. Looking again at the Apache error logs, /var/log/apache2/error.log
revealed errors in lightbox-plus
and crayon-syntax-highlighter
of the form Compilation failed: invalid range in character class
. From PHP 7.3, hyphens need to be escaped in regular expressions. I could have rolled the PHP version back further but decided to patch the offending files. (I probably need to review the plugins in use on the site and remove those that are no longer supported.)
And, finally, we’re back in business!