Support » Fixing WordPress » Critical Error updating to PHP 7.3

  • Resolved tcartr07


    Hello, I have a question and would appreciate some help and thanks in advance, I am new and not that technical my site is working fine and I am on PHP 7.2.29 and just on checking site health I have the one issue that say the PHP is old so to upgrade in my host cpanel is easy even for a novice.

    Switching to PHP 7.3 I get the message There has been a critical error on your website.
    My host only gave me the info
    (We have reviewed the error log of the application and it showed that there might be an issue with file wp-db.php on line 1661)

    They provided some more error messages I do not understand but suggest I contact a DEV, which I might have to as I am so new to this and have no idea.

    I changed the directory but here is the rest of the code they provided….If I have to ask a DEV to fix it so be it but if it is something I can be talked through so much better, and once again thanks for any assistance.

    [06-Apr-2020 02:05:10 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/mmmmmmm/public_html/wp-includes/wp-db.php:1661
    Stack trace:
    0 /home/mmmmmm/public_html/wp-includes/wp-db.php(631): wpdb->db_connect() 
    1 /home//public_html/wp-includes/load.php(426): wpdb->__construct('mmmmmm_wp746', 'ySQ5p.5[57', 'mmmmmm_wp746', 'localhost') 
    2 /home/mmmmmm/public_html/wp-settings.php(126): require_wp_db() 
    3 /home/mmmmmm/public_html/wp-config.php(77): require_once('/home/mmmmmmm/...') 
    4 /home/mmmmmm/public_html/wp-load.php(37): require_once('/home/formerte/...') 
    5 /home/mmmmmmm/public_html/wp-blog-header.php(13): require_once('/home/mmmmmm/...') 
    6 /home/mmmmmm/public_html/index.php(17): require('/home/mmmmmm/...') 
    thrown in /home/mmmmmm/public_html/wp-includes/wp-db.php on line 1661
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    Every time I’ve encountered this issue (on clients sites or here in the forums), switching to MySQL native driver fixed the the problem.

    Kindly confirm enabled (or enable if disabled):

    nd_mysqli (or whatever it’s named in you environment)

    And confirm disabled (or disable if enabled)


    If you have no idea how to do this, kindly contact your host for assistance.

    And please do report back!

    Moderator Yui



    You need mysqli extension for PHP, contact your host if you cannot find how to enable it via your hosting control panel

    Older PHP versions used mysql (without “I” , which means Improved) extension, but its deprecated for long time and does not exist for PHP 7+ (actually it does, but noone ships it)

    Thread Starter tcartr07


    I would like to thank you both for your reply and for your help.

    @gappiah I made those changes in my cpanel PHP selector and was able to switch to PHP 7.3 and the site is working with no issues reported by site health.

    Again my thanks and what a great community WordPress is and I hope to learn much more. 🙂

    I’m glad I could be of help.

    If you have a second to spare, kindly mark this thread as RESOLVED.

    Thank you, and stay safe!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Critical Error updating to PHP 7.3’ is closed to new replies.