Wordpress Fatal Error: Uncaught Error: Call to Undefined Function MySQL_Connect() in /Wp-Includes/Wp-Db.Php:1570

Uncaught Error: Call to undefined function mysql_connect() - WordPress Setup

I found the solution, All you have to do is uncomment these lines in php.ini

extension=mysqli
extension=pdo_mysql

Wordpress blog with technical difficulties after migrating to a PHP 7.3 server and even disabling all plugins

At the end it's been a combination of issues, but I've finally surrounded the problem to a WP plugin, that might not have PHP 7.3 (probably 7.2 neither, since I tried with it) support. The plugin folder is cystats.

So somehow at the beginning there was an incompatibility with this WP blog that had to do with mysql extension being enabled. After turning it off, it still didn't work, but it seems I didn't restart Apache, so I was seeing the old Call to undefined function mysql_connect() error.

Later, something messed up with all WP blogs (disabling mysqli extension), and finally, after having the original WP blog broken alone, I realized the error wasn't the same. Now it was:

Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function mysql_error() in /var/www/vhosts/mywpsite.com/httpdocs/wp-content/plugins/cystats/includes/cystats.class.php:1455

So finally everything is solved, clearly WP is compatible with PHP 7.3, and mysql extension must be disabled to work well with it. Some plugins might not be up to date, and that's the reason why they don't work with PHP 7.3 and why they worked on PHP 5.6.

So after migrating a WP blog to a new setup, plugins can ruin the migration if you don't figure it out.

Thanks for the help with the comments, they were definitely helpful as well.

As I read here Wordpress Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /wp-includes/wp-db.php:1570 it could have seemed that adding this line: define('WP_USE_EXT_MYSQL', true); would have made the plugin error go away, but the undefined mysql_connect error comes back if I set this define.

Fatal error: Uncaught Error: Call to undefined function mysql_connect()

mysql_* functions have been removed in PHP 7.

You probably have PHP 7 in XAMPP. You now have two alternatives: MySQLi and PDO.



Related Topics



Leave a reply



Submit