Given I’ve recently been doing a lot of server-based stuff on the work front, I decided to share some love with this here blog by upgrading PHP to version 7.3. It really does seem to make a difference, performance-wise.
Even though I’ve handled a few PHP 7.3 upgrades now, everyone is a little different, it seems.
Here’s what happened this time:
First, I added the repository reference
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
apt-get update failed, reporting a key error. I managed to get that one sorted using sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C then ran apt-get update again. All good!
Then I tried installing PHP 7.3 using sudo apt install php7.3 php7.3-common php7.3-cli
No dice. I received an Abort error, so I purged PHP 7.0 using sudo apt-get purge 'php*'
Then I tried installing again using just sudo apt install php7.3
Worked! So then I installed extensions using
sudo apt install php7.3-cli php7.3-fpm php7.3-json php7.3-pdo php7.3-mysql php7.3-zip php7.3-gd php7.3-mbstring php7.3-curl php7.3-xml php7.3-bcmath php7.3-json
After restarting my webserver, blog loaded but was clearly broken, with h2o error log reporting crayon-syntax-highlighter as the culprit.
A shout out to the folks at crunchify.com for pointing me in the direction of a quick fix for the crayon syntax highlighter plugin, which busted the site after the upgrade.
The plugin can be found on github.
My page speed scores still suck, but that will have to wait. Site seems to load much quicker 🙂