• Hey everybody! I read that apparently, WP has been compatible with PHP 8.1 for a long time now. Except, in my experience, it’s not.

    I have built and manage dozens of websites for various client over the past 6 years using a wide variety of tech stacks (plugins, themes) and hosting companies, I always keep WP up to date and literally 100% of my projects throw out tons of PHP errors in the back-end as soon as I switch to PHP 8.1. Example:

    https://paste.pics/M8HHV

    There’s no way I’m alone with this. How are you guys faring with PHP 8.1? I’m going back to 8.0 and crossing my fingers that eventually, WP will catch up. Meanwhile, if anybody has found a way to make the magic work, let me know.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’ve been running PHP 8.2 for 4 months on dozens of my own and client sites now (before then, 8.1) without any issues. Many mega hosts also run PHP 8.2.

    A couple of things to bear in mind:

    1) WordPress officially has “beta” support for PHP 8.0, 8.1 and 8.2. What this means is that there may be a few notices or warnings (or even a fatal error in some extreme, untested cases). But these warnings and notices should not break a site, and WordPress itself should work under PHP 8.x for most users.

    2) Compatibility with plugins and themes is a completely different beast. More commonly, it is plugins and themes that often break WordPress sites under PHP 8.x.

    Some of the “errors” in your screenshot directly refer to the WP Simple Firewall plugin.

    Others that show core WordPress files could actually be caused by a plugin or theme using deprecated (ie outdated) WordPress core functions. (Even the latest version of WordPress ships with a lot of old stuff so as to not break themes and plugins that still rely on these deprecated core functions.)

    3) All the “errors” in your screenshot are actually PHP warnings and notices. Most applications will always have some of these warnings and notices all the time. They are a useful tool for the developer to tweak their code to become more robust and performant, but their presence should not break your site.

    The only reason you’re seeing these “errors” at all is that you seem to have WordPress debugging turned on. On a production site, this is a big mistake as it can be a big performance hit and can have security concerns. You should turn off debugging on your live site, unless you’re actually debugging the site to fix code.

    Thread Starter MrMattEastwood

    (@mrmatteastwood)

    Thanks George! This is very helpful. I’m about to replace the WP Simple Firewall plugin (aka Shield Security) anyway. I’ll look into WP debugging for sure, too. I never knowingly enabled it on any of my projects, so I’m a bit baffled. I’ll see what I can find out about this.

    i would say php 8.0+ was a major update and it was a challenge to make things compatible with it for every developers.

    https://yoast.com/developer-blog/the-2020-wordpress-and-php-8-compatibility-report/

    But we all are gradually moving towards php 8.0. If you can’t live without php 8.0 , you must learn way to ignore debug errors.

    Thread Starter MrMattEastwood

    (@mrmatteastwood)

    Thanks for following up! Yeah, hosting companies have been pushing for it for a while. I have yet to see debug messages/errors with PHP 8.0, only 8.1. Also, I checked and I don’t have debugging enabled on my projects. For now, I’m absolutely happy with 8.0.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Compatibility with PHP 8.1’ is closed to new replies.