I suspect this one will be one of the most common coding mistakes found when upgraded to PHP v8.1.Įxample of bad code: $classes = implode( $class_array,' ' ) Įxample of corrected code: $classes = implode( ' ', $class_array ) Common PHP 8 fatal errors and how to solve them. I likewise had this same coding issue within my own toolkit that needed to be fixed. In older versions of PHP, it used to work no matter which was first, the array or the separator string. PHP’s implode function requires the separator first then the array. PHP’s implode function includes breaking changes. If the server logs are empty, try enabling WP_DEBUG and review the debug logs. Review PHP server logs for references to the lines of code causing issues. Most PHP compatibility issues are obvious as the website frontend or backend no longer works. That means bulk upgrades to PHP v8.1 (or 8.0) should be completed before that time so that the rollback option is there available if needed. Kinsta will be disabling PHP v7.4 as an option beginning on November 29th, 2022 for live sites. If you wait too long you won’t have the option to revert back to PHP 7.4. It pays to upgrade things early and not wait until the deadline. That said I was able to reach out to Kinsta support and have them bulk update any staging environment running PHP 7.4 to 8.1. Anchor Hosting uses Kinsta which doesn’t have a bulk PHP update option. This is a great way to catch major issues, like a full site crash. Upgrade all staging environments first.Unlicensed add-ons typically do not receive updates. Also, look for unlicensed add-ons and get them properly licensed. Most problems you’ll run into with PHP 8.1 are due to outdated themes and plugins. Before running PHP upgrades, here are a few suggestions. While deploying updates here at Anchor Hosting I’ve compiled a list of common compatibility fixes that were necessary for PHP 8.x. My initial bulk upgrade attempt found around 300 sites out of 1500 not ready for PHP 8, which required manual efforts to resolve a wide range of PHP fatal errors. I plan to upgrade and patch the remaining customers for PHP 8.1 before Nov 28th. I’m happy to report that nearly all customers running PHP 7.4 has been upgraded to PHP v8.1. At Anchor Hosting we make sure all customer’s websites are running a supported version of PHP. If you haven’t upgraded your WordPress website to PHP 8 or 8.1, now is the time. The end of life for PHP 7.4 is on November 28th, 2022.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |