A little after 3 p.m. on August 29, 2021, I noticed that the latest version of the theme had added quite a few features. That got me thinking it was probably time to update the blog theme.
The update finished, and almost immediately everything broke.
WordPress reported that PHP needed to be higher than version 7.2. Since I had already failed several times trying to upgrade PHP in the past, I decided this time I was going to get it done properly and went straight into the server backend to deal with the PHP upgrade.
After quite a bit of trouble, PHP was finally upgraded. But the moment I brought things back up, the blog was inaccessible. At first it was returning a 500 error, so I suspected WordPress. After checking the logs, it looked like the issue might actually be with Nginx. I restarted Nginx, only to find that the site failed even more directly.
Then I discovered that the Nginx configuration file had been altered by rpm. I added the configuration back in, reloaded Nginx, and the 500 error returned again.
At that point I started doubting whether the PHP upgrade had really succeeded. I checked the PHP runtime logs, and everything looked normal. PHP itself did not seem to be the problem.
Very frustrating.
By then, the blog had already been down for two hours.
I was getting pretty irritated and had started backing up data, ready to move into a full recovery process.
And then I suddenly noticed this line in the logs:
Warning: require_once(/var/www/wordpress/wp-config.php): failed to open stream: Permission denied in /var/www/wordpress/wp-load.php on line 37
No permission? That explained it.
I checked the user group in the PHP configuration file and found it was set to apache. There was the problem. I changed it to nginx, restarted php-fpm, and tried the site again. Finally, the blog loaded, complete with the updated theme.
A nearly three-hour battle, all for what was supposed to be a simple theme upgrade.
Leaving this here as a record.