PHP 8.4

Not a lot to say about it, but this site is now running PHP 8.4. Meaning I’m now completely current. When I set up this server, PHP 8.2 wasn’t quite current, but it was the best AWS had available and I did not want to do a full-blown install from source, so I lived with it.

Now 8.2 is on security support only. Current is 8.4, which will remain with full support for almost 2 more years, as PHP major versions are released annually, with full support for two years after the release. WordPress claims to be fine with anything from 7.4 up, so I doubt I’ll run into any issues running an older version, but my years at AWS drilled regular patching into my psyche, so it’s always irked me.

The upgrade was painless, since I took the trouble of writing up everything I did to install it in the first place.

I started with a snapshot of my root drive as it existed before I did anything. I have a recent one, as I take a snapshot every time I make any significant changes, but always best to be sure.

With that done, based on my previous experience, it’s best to just get rid of what’s there:

sudo dnf remove php*

Then reinstall everything to the new version:

sudo dnf install -y php8.4 php8.4-fpm php8.4-gd php8.4-mysqlnd php8.4-devel php8.4-intl

Reinstall the necessary Imagemagick bits:

sudo pecl install imagick

And zip:

sudo pecl install zip

[The system-level imagemagick and zip packages remained in place and were not removed along with php, but the extensions that allow php to use their APIs need to be installed from PECL.]

Make sure the installed files have the right permissions:

sudo chmod 755 /usr/lib64/php8.4/modules/imagick.so
sudo chmod 755 /usr/lib64/php8.4/modules/zip.so

Then finally add references to the .so files from both of the above to php.ini, since that was wiped out along with all the other removed php files :

extension=imagick.so
extension=zip.so

This time around I created a new file to hold them in /etc/php.d, so there is now a new file named 40-extensions.ini, which along with all the other .ini files in the php.d directory, is loaded at php startup.

Rebooted. It worked the first time.

Other housekeeping

I upgraded the RDS server to the latest MariaDB version. It’s now on 11.4.5.

Then I took another snapshot of the root drive on my server, post upgrades, and kept it along with the “pre upgrade” version. Some problems don’t reveal themselves immediately, so best to have both.

Other than routine OS patches, I should be good for a year.

Michael Gat