Recently, I asked myself if my WordPress blog was ready for PHP 8 already?
Why did I care? PHP 7 ran much faster than PHP 5 did, and the upgrade to PHP 8 also promises to benefit web speed and thus, better web performance, which is, in turn, helpful for search engine ranking (even more so with the Core Web Vitals update in May 2021).
Some still see PHP as an “Ugly Duckling” …
It is amazing to see how PHP has evolved, both its core performance and syntax, as well as the community standards (PSR) that provided de-facto standards that make it much easier to learn one framework, like Symfony, if you already know another one, like Laravel.
… turning into a beautiful big blue elephant!
Looking back at the release dates, PHP 7 was released in 2015 already, and I am sure, I was no early adopter back then. But as my personal WordPress blog, Open-Mind-Culture.org, primarily serves the purpose of testing WordPress features, themes, and plugins, I was ready to give it a try.
I had some plugins installed, including performance optimization features, Google Site Kit, and Polylang to provide a framework for writing in English and in German on the same domain.
“This is fine.”
After switching the PHP version to “8.0” on my host, everything still seemed to work well, so I forgot about the whole thing until I wanted to write a new blog post.
WordPress suggested updating my plugins, but trying to do so always failed with a 500 internal server error, and I thought it might be a temporary glitch on the update server. So I decided to try again later.
No Plugin Updates, No Image Uploads
Then I tried to upload a new image to a post, which constantly failed with the message
"Post-processing of the image failed. If this is a photo or a large image, please scale it down to 2500 pixels and upload it again", you should watch the video carefully."
The generic error message was not helpful, but rather misleading. Uploading a smaller image did not help.
I check the update page, WordPress was up to date, version 5.7 already installed without issues when it was released. Two plugins outdated, both still failing when trying to update.
Finally, it dawned on me, that I recently switched to PHP 8.
After downgrading to the recommended, stable, PHP 7.4, my blog worked again.
Doing some research, at least use google!
To be fair, Yoast published a WordPress and PHP 8 Compatibility report in 2020 which dives deep into all of the details.
Hope and Compatibility
Hopefully, next time, all of my plugins will be ready, and PHP 8 will make my website even faster than it was before. And I will refrain from using any new feature in any public plugin or theme in the near future, and rather try to make them compatible with any PHP version from 5.6 upwards.
P.S. this is a more lengthy rewrite of my original post on dev.to: Did I upgrade WordPress to PHP 8 too early?