Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php:1643 Stack trace: #0 C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php(639): wpdb->db_connect() #1 C:\Apache24\htdocs\wordpress\wp-includes\load.php(427): wpdb->__construct('root', 'root', 'wordpress', 'localhost') #2 C:\Apache24\htdocs\wordpress\wp-settings.php(120): require_wp_db() #3 C:\Apache24\htdocs\wordpress\wp-config.php(92): require_once('C:\Apache24\htd...') #4 C:\Apache24\htdocs\wordpress\wp-load.php(37): require_once('C:\Apache24\htd...') #5 C:\Apache24\htdocs\wordpress\wp-blog-header.php(13): require_once('C:\Apache24\htd...') #6 C:\Apache24\htdocs\wordpress\index.php(17): require('C:\Apache24\htd...') #7 {main} thrown in C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php on line 1643
1
votes
1 Answers
1
votes
As bassxzero said, mysql_connect was removed from PHP since the 7.0 version. See https://www.php.net/manual/en/function.mysql-connect.php
This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used.
You have two choices :
You can continue to use an old version of Wordpress, and make it run on an older version of PHP (for exemple v5.6) => not recommanded. See https://www.php.net/supported-versions.php Plus old versions of Wordpress have security issues.
You can update Wordpress and it will work fine with PHP 7.3. That's what you should do. Current stable version is 5.2.2. See https://wordpress.org/download/releases/
mysql_*
was removed in php 7.0 – bassxzero