With the pending retirement of PHP 7.3 the last thing on last months list of things to do was to update PHP to a supported version.
re-building from ports is not easy, but is straight forward. First generate a list of all your installed php packages and save safely where you can access it. Then use pkg delete -f to remove each package on your list. Not forgetting mod_php73 and then find the version of php you want to replace with in /usr/ports/lang and then install php80 and php80_extensions.
I had planned to jump straight to PHP 8.1, but the php81-dom extension is no longer available to install. Ditto php81-hash and php81-json. Thankfully I didn’t need -hash nor json and rolling back to PHP8.0 sufficed.
60 minutes later after manually deinstalling and then installing I had a working system. Well, almost, in my haste to reboot the server, I had forgotten to install mod_php80 so on the reboot Apache failed to start as it did not recognise some of the php injects in the httpd.conf. Rem’ing the errant comments out did not work either as when Apache now started, it could not interpret the .php files and dumped them straight to the screen. Then the penny dropped and a quick install of mod_php80 and reboot finally made Apache happy and everything working again.
Why reboot and not just stop/start Apache et al. Well its a small test rig and not running any production grade services so a complete clear out of the memory from any residual horlicks I have made in past configs or port building means I give it the best hope of running smoothly until the next big upgrade.