When visiting your WordPress site, it's possible you may see this error:
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
This is caused when the PHP code in your site is not compatible with the version of PHP your site is currently using. More specifically, the issue is with the outdated MySQL extension which was removed as of PHP 7.0.
If you're using any version of PHP above 7.0 and you're seeing this error, it's due to old code that needs to be updated. You will need to upgrade the core WordPress files to the current version, as well as any plugins your site is using.
Check which version of PHP you're site is using
First, check which version of PHP your site is using with a phpinfo.php file.
Make sure it matches the version of PHP your panel shows for your domain.
Updating your code
If your website has been upgraded to a version of PHP over 7.0 and you're seeing this error, it means you must update your WordPress core version and plugins to use the newer MySQLi or PDO_MySQL extensions instead.
If you've installed WordPress as a One-Click Install, you can manually upgrade it in your panel, or set is to auto-update.
- How to upgrade a One-Click Install
- How to set your One-Click WordPress installation to automatically update
And you can update your plugins in your dashboard.
For Dedicated servers
If you're on a Dedicated server, your MySQL version may be 5.6. If so, and you're seeing this error, add the following line to your site's phprc file.
extension = mysql.so
View the following article for instructions on how to add this information: