• Resolved farnely

    (@farnely)


    When I switch to using PHP 8, WordPress throws this error:-

    PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/XXXXXXX/public_html/wp-includes/wp-db.php:1785
    Stack trace:
    #0 /home/XXXXXXX/public_html/wp-includes/wp-db.php(724): wpdb->db_connect()
    #1 /home/XXXXXXX/public_html/wp-includes/load.php(561): wpdb->__construct()
    #2 /home/XXXXXXX/public_html/wp-settings.php(124): require_wp_db()
    #3 /home/XXXXXXX/custom-folder/wp-config.php(115): require_once(‘/home/XXXXXXX/…’)
    #4 /home/XXXXXXX/public_html/wp-config.php(5): require_once(‘/home/XXXXXXX/…’)
    #5 /home/XXXXXXX/public_html/wp-load.php(50): require_once(‘/home/XXXXXXX/…’)
    #6 /home/XXXXXXX/public_html/wp-blog-header.php(13): require_once(‘/home/XXXXXXX/…’)
    #7 /home/XXXXXXX/public_html/index.php(17): require(‘/home/XXXXXXX/…’)
    #8 {main}
    thrown in /home/XXXXXXX/public_html/wp-includes/wp-db.php on line 1785

    My wp-config file resides outside public_html for security reasons and has worked with all previous PHP releases (up to and including 7.4).

    Any idea what the problem might be please?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Little Package

    (@littlepackage)

    Hi @farnely

    Please check that mysqli is enabled in your server’s PHP configuration.

    Dion

    (@diondesigns)

    Also make sure the mysqlnd PHP extension is enabled.

    Thread Starter farnely

    (@farnely)

    Thank you both for your replies. mysqli wasn’t an available module for PHP 8 in cPanel but nd_mysql was. Checking nd_mysql solved the issue; appreciate your help.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP 8’ is closed to new replies.