PHP 8.0 Fatal error |

I have several WordPress sites running on a LAMP server with PHP 7.2, 7.3 and 7.4 installed. All sites with various themes were running on PHP 7.4. When PHP 8.0.1 was released early in January, it was added. WordPress version was 5.6. I checked all the sites and was happy that all except one could be opened, although some had errors from plugins. The site that would not open had a fatal error, not seen since moving from PHP 5.6 to 7.x, where mysql was deprecated.

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /wp-includes/wp-db.php:1685
Stack trace:
#0 /wp-includes/wp-db.php(632): wpdb->db_connect()
#1 /wp-includes/load.php(527): wpdb->__construct('root', 'rootpw', 'wp_fwhr', 'localhost')
#2 /wp-settings.php(124): require_wp_db() 
#3 /wp-config.php(100): require_once('/srv/http/wordp...') 
#4 /wp-load.php(37): require_once('/srv/http/wordp...') 
#5 /wp-blog-header.php(13): require_once('/srv/http/wordp...') 
#6 /index.php(17): require('/srv/http/wordp...') 
#7 {main} thrown in /wp-includes/wp-db.php on line 1685

Although no other site displayed this error and it had not occurred with any PHP 7.x version, it was suspected that the error was perhaps caused by the Twenty Sixteen theme, or a plugin. However, changing to Twenty Twenty-One theme and deactivating all the plugins does not help, but reverting back to PHP 7.4 stopped the error.

There is no line: define('WP_USE_EXT_MYSQL', true); in the wp-config.php file.
The .htacess file contents were replaced with the basic vanilla version.
The index.php is unchanged.
Updating WordPress to 5.6.1 has made no difference.
Thorough checks for errors in the php.ini file showed nothing missing: mysqli, mysqlnd and pdo_mysql extensions installed and showing as loaded in the terminal with php -m.

What am I missing? Does anyone familiar with all the core files see something in the stack trace?

Source link