Support » Fixing WordPress » Fatal error: Uncaught Error: Call to undefined function mysql_connect()

  • I recently updated wordpress manually and also upgraded php to version 7.3.
    My website displays the following error:
    Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/pancelah/public_html/wp-includes/wp-db.php:1643 Stack trace: #0 /home/pancelah/public_html/wp-includes/wp-db.php(639): wpdb->db_connect() #1 /home/pancelah/public_html/wp-includes/load.php(427): wpdb->__construct(”, ‘(‘, ”, ‘localhost’) #2 /home/pancelah/public_html/wp-settings.php(120): require_wp_db() #3 /home/pancelah/public_html/wp-config.php(90): require_once(‘/home/pancelah/…’) #4 /home/pancelah/public_html/wp-load.php(37): require_once(‘/home/pancelah/…’) #5 /home/pancelah/public_html/wp-blog-header.php(13): require_once(‘/home/pancelah/…’) #6 /home/pancelah/public_html/index.php(17): require(‘/home/pancelah/…’) #7 {main} thrown in /home/pancelah/public_html/wp-includes/wp-db.php on line 1643
    The site is experiencing technical difficulties.

    I can’t even login to the website via php-admin all I get is “Index of /wp-admin”

    How do I fix this.
    P.S I’m not an advanced developer so and would really appreciate an answer that’s more or less for a newbie.
    Any help will be highly appreciated.
    Thanks

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    How did you upgrade to 7.3? If you had your host do it, contact them to let them know they need to install the library php-mysqlnd.

    It’s odd that your site is using mysql_connect instead of mysqli_connect. What version of WP is it?

    Thread Starter benso

    (@benso)

    Hi thanks for your reply Steve Stern (@sterndata). I upgraded via cpanel choose php version. WordPress version is 5.2.1.
    The reason for upgrading manually via cpanel is because the automatic upgrade wasn’t working and also manual upgrade via admin dashboard when I click the update button wasn’t working too.

    • This reply was modified 1 year, 11 months ago by benso.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    Please contact your host as this is an error in the PHP library structure.

    Thread Starter benso

    (@benso)

    Thank you for your response. When I revert to PHP 5.6 I get the following error instead

    Fatal error: Call to undefined function _get_custom_object_labels() in /home/pancelah/public_html/wp-includes/taxonomy.php on line 572

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    What else did you change?

    Thread Starter benso

    (@benso)

    I only changed PHP version and manually updated the wordpress version. When I contacted the host service provider they told me to re-upload the home directory with the backup I had made before I did the upgrade but even doing that hasn’t changed things. I’m still getting the errors.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    I’d try a manual update of WP:

    Updating WordPress

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fatal error: Uncaught Error: Call to undefined function mysql_connect()’ is closed to new replies.