Welcome to Centmin Mod Community
Register Now

Wordpress PHP 8.1.1 : HTTP ERROR 500 mysqli_sql_exception after WP vhost creation

Discussion in 'Blogs & CMS usage' started by Benjamin74, Dec 27, 2021.

  1. Benjamin74

    Benjamin74 Premium Member Premium Member

    61
    6
    8
    May 2, 2016
    Ratings:
    +13
    Local Time:
    9:36 PM
    Hello,

    On a VPS for which I recently upgraded PHP to version 8.1.1 (was running on 7.4.something), I can't get any new WP vhost installation to work...

    It always creates HTTP ERROR 500

    Fatal error: Uncaught mysqli_sql_exception: Table 'wp1389712830db_17489.31757_options' doesn't exist in /home/nginx/domains/blabla.com/public/wp-includes/wp-db.php:2056

    I've run cmupdate before running the PHP upgrade.

    • CentOS Version: centos-release-7-9.2009.1.el7.centos.x86_64
    • Centmin Mod Version Installed: i.e. 123.09beta01
    • Nginx Version Installed: 1.21.3
    • PHP Version Installed: 8.1.1
    • MariaDB MySQL Version Installed: hummm don't know, I didn't change anything
    • When was last time updated Centmin Mod code base ? : today
    • Persistent Config:
    Code:
    LETSENCRYPT_DETECT='y'
    PHP_BROTLI='y'
    NGXDYNAMIC_BROTLI='y'
    NGINX_LIBBROTLI='y'
    PHP_PGO='y'
    AUTODETECPHP_OVERRIDE='y'

    I'm a little clueless, the only stuff I could find online was this:


    PHP 8.1 fatal error

    Basically saying I shouldn't expect 8.1.1 to work correctly with WP...

    What's the consensus here on the max version of PHP we should use ?

    I'm not sure what's broken (maybe it's a WP-CLI issue? because the problem is only with newly created vhosts... older wp hosts work fine)

    Thanks,
     
  2. buik

    buik “The best traveler is one without a camera.” Premium Member

    1,510
    412
    83
    Apr 29, 2016
    Flanders
    Ratings:
    +1,291
    Local Time:
    9:36 PM
    The latest Wordpress as of today does not support up to PHP 8.1.
    The latest safe PHP version to use is PHP 7.4.
    Even PHP 8.0 is not fully supported by Wordpress.

    Same goes for WP-CLI, which addresses PHP through the command line and thus also causes compatibility issues. For example when installing/editting Wordpress sites via the Linux terminal.

    .
     
    Last edited: Dec 27, 2021
  3. eva2000

    eva2000 Administrator Staff Member

    47,851
    10,920
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,961
    Local Time:
    6:36 AM
    Nginx 1.21.x
    MariaDB 10.x
    Yup WordPress does not support PHP 8.1 as yet
     
  4. Benjamin74

    Benjamin74 Premium Member Premium Member

    61
    6
    8
    May 2, 2016
    Ratings:
    +13
    Local Time:
    9:36 PM
    Thanks guys, somehow I expected WP to work 1 year after PHP 8 release (and couldn't wait as I was very enthusiastic moving to PHP 8 cause of eva2000 php8's improvements benchmarks ;-) ).
     
  5. eva2000

    eva2000 Administrator Staff Member

    47,851
    10,920
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,961
    Local Time:
    6:36 AM
    Nginx 1.21.x
    MariaDB 10.x
    Yeah originally Wordpress folks slated Wordpress 5.6 for PHP 8 support, but development lagged so Wordpress 5.8 isn't ready fully for PHP 8 and they're still working on PHP 8.0/8.1 support for Wordpress 5.9 betas!

    Also Centmin Mod's centmin.sh menu option 22 Wordpress auto installer uses WP CLI command line tool for Wordpress install and configuration and WP CLI isn't PHP 8 ready either! Best bet for dev testing is install Wordpress using PHP 7.4 and then upgrade to PHP 8 via centmin.sh menu option 5 for development testing of PHP 8 progress.
     
    Last edited: Dec 27, 2021
  6. eva2000

    eva2000 Administrator Staff Member

    47,851
    10,920
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,961
    Local Time:
    6:36 AM
    Nginx 1.21.x
    MariaDB 10.x
    FYI, I am working on a Wordpress, PHP and WP CLI version checker tool that I will eventually integrate into centmin.sh menu option 22 Wordpress auto installer so can warn folks BEFORE installing Wordpress as to max version compatibility requirements

    Code (Text):
    ./wp-phpcheck.sh check
    -------------------------------------------------------------------------------
     debug: Latest WP CLI Version Available: 2.5.0
     debug: Latest WP CLI Version String Available: 2005000
     debug: Current Installed WP CLI Version: 2.5.0
     debug: Current Installed WP CLI String Version: 2005000
    -------------------------------------------------------------------------------
     debug: Current Installed PHP Branch: getlatest_phpbranch=81
     debug: WP Max PHP Supported Branch: wp_getlatest_phpbranch=74
     debug: Error. Current installed PHP 8.1.1 is not supported by Wordpress 5.8.x
     debug: Error. WP CLI Max Supported PHP version: 7.4.27
    -------------------------------------------------------------------------------
    Wordpress 5.8.x Max Supported PHP Version:   7.4.27
    Latest Wordpress Stable Version Available:   5.8.2
    Latest Wordpress Beta Version Available:     5.9-beta4
    Latest WP CLI Version Available:             2.5.0
    Latest PHP Version Available For Update:     8.1.1
    Current WP CLI Version Installed:            2.5.0
    Current PHP Version Installed:               8.1.1
    -------------------------------------------------------------------------------
    Error. WP CLI Max Supported PHP version: 7.4.27
    -------------------------------------------------------------------------------
    Error. Current installed PHP 8.1.1 is not supported by Wordpress 5.8.x
    -------------------------------------------------------------------------------
    
    echo $?
    1
    
     
  7. buik

    buik “The best traveler is one without a camera.” Premium Member

    1,510
    412
    83
    Apr 29, 2016
    Flanders
    Ratings:
    +1,291
    Local Time:
    9:36 PM
    Totally understandable.
    PHP has, in my opinion, a poor support cycle model.
    No LTS release, for example.
    With releases far too short in succession.

    With all the consequences this entails. PHP 7.4 is already out of active support
    (only critical security updates) while most PHP based stable products do not even support PHP 8.0 yet. And even then: PHP 8.0 loses active support in less than 10 months.
    This is almost mission impossible.....

    Many PHP-based projects are based entirely on open source and open source volunteers. Sometimes a voluntary development process just can't be done any faster.

     
  8. Jay Chen

    Jay Chen Active Member

    171
    53
    28
    Sep 10, 2017
    Ratings:
    +104
    Local Time:
    3:36 PM
    I had the same issue with PHP 8.1, downgraded to 8.0 and problem solved.
    Today is the first day I am running Wordpress on PHP 8.0, lets hope it goes smooth.