Title: Fatal Error when switch to PHP 8
Last modified: July 12, 2021

---

# Fatal Error when switch to PHP 8

 *  Resolved [LRA21](https://wordpress.org/support/users/slysoft/)
 * (@slysoft)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-switch-to-php-8/)
 * I’ve got this when I switch from **PHP 7.4** to **PHP8**
 *     ```
       Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/r60846/public_html/wp-includes/wp-db.php:1688 
       Stack trace: 
       #0 /home/r60846/public_html/wp-includes/wp-db.php(632): wpdb->db_connect() 
       #1 /home/r60846/public_html/wp-includes/load.php(545): wpdb->__construct() 
       #2 /home/r60846/public_html/wp-settings.php(124): require_wp_db() 
       #3 /home/r60846/public_html/wp-config.php(78): require_once('/home/r6084...') 
       #4 /home/r60846/public_html/wp-load.php(37): require_once('/home/r60846...') 
       #5 /home/r60846/public_html/wp-blog-header.php(13): require_once('/home/r6084...') 
       #6 /home/r60846/public_html/index.php(17): require('/home/r60846...') 
       #7 {main} thrown in /home/r60846/public_html/wp-includes/wp-db.php on line 1688
   
       There has been a critical error on this website.
       ```
   
 * I disabled plugins also, still in error.
    With the _twentytwentyone default WP
   theme_ works like charm.
 * How to fix that?
 * Thank you!

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

 *  [udidol](https://wordpress.org/support/users/udidol/)
 * (@udidol)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-switch-to-php-8/#post-14655031)
 * Hey,
    Can you share your system info? From the Admin Dashboard > Elementor > 
   System Info
 *  Thread Starter [LRA21](https://wordpress.org/support/users/slysoft/)
 * (@slysoft)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-switch-to-php-8/#post-14656093)
 * == Server Environment ==
    Operating System: Linux Software: LiteSpeed MySQL version:
   MariaDB Server v10.3.27 PHP Version: 7.4.15 PHP Max Input Vars: 10000 PHP Max
   Post Size: 512M GD Installed: Yes ZIP Installed: Yes Write Permissions: All right
   Elementor Library: Connected
 * == WordPress Environment ==
    Version: 5.7.2 Site URL: [https://**************](https://**************)
   Home URL: [https://**************](https://**************) WP Multisite: No Max
   Upload Size: 512 MB Memory limit: 1024M Permalink Structure: /%postname%/ Language:
   en-US Timezone: Europe/Bucharest Debug Mode: Inactive
 * == Theme ==
    Name: Hello Elementor Child Version: 1.0.1 Author: Elementor Team
   Child Theme: Yes Parent Theme Name: Hello Elementor Parent Theme Version: 2.4.1
   Parent Theme Author: Elementor Team
 *  Thread Starter [LRA21](https://wordpress.org/support/users/slysoft/)
 * (@slysoft)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-switch-to-php-8/#post-14658836)
 * I forgot to mention that this problem is the same on several servers of different
   hosting providers. I am forced for this reason to stay at PHP 7.4
 *  [udidol](https://wordpress.org/support/users/udidol/)
 * (@udidol)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-switch-to-php-8/#post-14663312)
 * We could not reproduce this issue, so we would like you to run some tests to 
   help us pinpoint the problem.
 * Your plugins list is missing from the System Info report.
    What plugins do you
   have installed?
 * Try disabling all of your plugins and see if this issue persists.
    If it does
   not, then activate your plugins one by one (starting with Elementor), and see
   which plugin causes your issue.
 * Please share the results of this procedure.
    -  This reply was modified 4 years, 11 months ago by [udidol](https://wordpress.org/support/users/udidol/).
 *  Thread Starter [LRA21](https://wordpress.org/support/users/slysoft/)
 * (@slysoft)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-switch-to-php-8/#post-14664526)
 * As I said in the main post, this error is present if plugins are disabled.
    Right
   now, I installed a fresh WP on other server. No plugins! Same error. I sent an
   email to hosting support too.
 *     ```
       Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home3/r90973alup/public_html/wp-includes/wp-db.php:1688 Stack trace: #0 /home3/r90973alup/public_html/wp-includes/wp-db.php(632): wpdb->db_connect() #1 /home3/r90973alup/public_html/wp-includes/load.php(545): wpdb->__construct() #2 /home3/r90973alup/public_html/wp-settings.php(124): require_wp_db() #3 /home3/r90973alup/public_html/wp-config.php(90): require_once('/home3/r90973al...') #4 /home3/r90973alup/public_html/wp-load.php(37): require_once('/home3/r90973al...') #5 /home3/r90973alup/public_html/wp-admin/admin.php(34): require_once('/home3/r90973al...') #6 /home3/r90973alup/public_html/wp-admin/update-core.php(10): require_once('/home3/r90973al...') #7 {main} thrown in /home3/r90973alup/public_html/wp-includes/wp-db.php on line 1688
   
       There has been a critical error on this website. Please check your site admin email inbox for instructions.
       ```
   
 *  Thread Starter [LRA21](https://wordpress.org/support/users/slysoft/)
 * (@slysoft)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-switch-to-php-8/#post-14664716)
 * It seems, according to the hosts, that it does not support PHP 8, even if it 
   is displayed in cPanel and available for selection. So I clarified and closed
   the topic. Thank you for your support!

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

The topic ‘Fatal Error when switch to PHP 8’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/hello-elementor/3.4.9/screenshot.
   png)
 * Hello Elementor
 * [Support Threads](https://wordpress.org/support/theme/hello-elementor/)
 * [Active Topics](https://wordpress.org/support/theme/hello-elementor/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/hello-elementor/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/hello-elementor/reviews/)

## Tags

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [hello theme](https://wordpress.org/support/topic-tag/hello-theme/)
 * [uncaught error](https://wordpress.org/support/topic-tag/uncaught-error/)

 * 6 replies
 * 2 participants
 * Last reply from: [LRA21](https://wordpress.org/support/users/slysoft/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-switch-to-php-8/#post-14664716)
 * Status: resolved