How do I fix the error below?
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
I
Just install apt-get install php5-mysqlnd Restart Apache service apache2 restart
Make sure msqli and mysqlnd are checked in your php selector. Then go over change the name of your .htaccess file to .htaccess_old. See if your site can load now.
If it works, then go to your dashboard and save your permalinks, it will create a new .htaccess file.
This worked for me.
As few people shared to tick mark the checkbox for mysqli and mysqlind
but Hostgator (webhosting site) now does not give that option to select extension via the cpanel as that option is removed select PHP and now it gives the option for php manager
You can just select the Php version you want and not the extension.
Solution :- Called the hostgator , first time they said get in touch with your developer, ( i asked my brother and he downloaded the files locally and verified it was working fine on local system) <-- this was not needed though
Again called the hostgator and their backend team installed the missing extension and it was solved.
Below is the code which gives this error when it does not find the extension and you can find this line in load.php via ftp.
if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! extension_loaded( 'mysqlnd' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
require_once ABSPATH . WPINC . '/functions.php';
wp_load_translations_early();
$args = array(
'exit' => false,
'code' => 'mysql_not_found',
);
wp_die(
__( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ),
__( 'Requirements Not Met' ),
$args
);
exit( 1 );
}
}
The source of this message was unrelated to the solution in my case.
My ip address of my server changed and i didn't change the <VirtualHost>
directive in my httpd.conf of the apache server.
Once i changed it to the correct ip address the message disappeared and Wordpress is working again.
The php mysql api is deprecated. It's kaput --- going away -- not to be used, finito.
If you have a modern version of PHP (> 5.6) then Wordpress should automatically switch to make use of mysqli. That should be your first attempt.
If you can not update your php, rather than attempting to resurrect something that php no longer supports, just patch your wordpress: http://wordpress.org/plugins/mysqli/
I just removed custom php ini, which I don't use at all. The problem gone, site is working fine.