Support » Fixing WordPress » Not able to upgrade PHP

  • Hello all! I have a problem with my site when updating the PHP-version from 5.6 to anything above that. The site crashes and I get a fatal error that says:

    Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/mysite/public_html/wp-includes/wp-db.php:1661 Stack trace: #0 /home/mysite/public_html/wp-includes/wp-db.php(631): wpdb->db_connect() #1 /home/mysite/public_html/wp-includes/load.php(426): wpdb->__construct(‘mysite_wp1’, ‘U@U4OuCz8139][7’, ‘mysite_wp1’, ‘localhost’) #2 /home/mysite/public_html/wp-settings.php(126): require_wp_db() #3 /home/mysite/public_html/wp-config.php(102): require_once(‘/home/mysite/…’) #4 /home/mysite/public_html/wp-load.php(37): require_once(‘/home/mysite/…’) #5 /home/mysite/public_html/wp-blog-header.php(13): require_once(‘/home/mysite/…’) #6 /home/mysite/public_html/index.php(17): require(‘/home/mysite/…’) #7 {main} thrown in /home/mysite/public_html/wp-includes/wp-db.php on line 1661

    Something seems to be wrong in document public_html/wp-includes/wp-db.php on line 1661.

    So here’s what I have on lines 1659-1662

    Lines 1659-1662
    } else {
    // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
    $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
    }

    Everything on my site is up to date.
    Thank you for any help!

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ask your host to help you upgrade your PHP. There’s probably a library you need to turn on.

    Thread Starter norah98

    (@norah98)

    Could you be more specific? My host does not know what causes this error and the advise me to turn to WordPress support. When they do the PHP update for me the result is the same.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not able to upgrade PHP’ is closed to new replies.