If you’ve stumbled upon a strange error message that reads ‘Your PHP installation appears to be missing the MySQL extension which is required by WordPress‘, don’t panic! This error is commonly encountered by those using WordPress and, while it may seem intimidating, it is fairly simple to fix.
This beginner guide will provide you with a clear understanding of the reasons behind this error and step-by-step instructions on how to resolve it!
Understanding the Error
Before diving into the resolution, let’s understand what the error message means. WordPress is built on PHP, a server-side scripting language, and MySQL, a database management system. When your PHP installation lacks the MySQL extension, WordPress fails to operate correctly due to the absence of a crucial component.
This issue can commonly occur after migrating your website to a new host, upgrading your PHP version, or installing a new copy of WordPress.
Step-by-Step Guide To Resolve The Issue
Step 1: Contact Your Hosting Provider
The easiest and quickest solution may be to contact your web hosting provider. Most providers offer excellent support and should be able to help in enabling the MySQL extension on your PHP installation.
Step 2: Check Your PHP Version
If for any reason, the issue persists, the next step is to check your PHP version. WordPress recommends a PHP version of 7.4 or greater. You can check your PHP version from the cPanel of your hosting account or by creating a simple PHP info file.
To create a PHP info file, follow these steps:
- Create a new file and name it
- Open the file and insert the following code:
<?php phpinfo(); ?>
- Save and upload this file to your website root directory using an FTP client
- Navigate your browser to
This will display a page with all your PHP configuration information, including the PHP version.
If you’re using an outdated PHP version, you’ll need to update your PHP version. Refer to this helpful guide by WordPress on changing to PHP 7.
Step 3: Enable MySQL Extension
If your PHP version is up-to-date yet you’re still facing the error, you might have to enable the MySQL extension manually.
Here is how you can do that:
- Locate your
php.inifile: This file resides in your server’s root folder. If you can’t find it, contact your hosting provider.
- Edit the
php.inifile: Open the file and search for a line of code that reads,
extension=mysqli. If the line is there but commented out (preceded by a semicolon), uncomment it by removing the semicolon. If the line isn’t there, add it yourself.
- Save your changes and restart your server: After editing, save and close the
php.inifile. Lastly, you need to restart your web server for changes to take effect.
Step 4: Configure Your wp-config.php File
If the above steps didn’t work, there might be a problem with your wp-config.php file. You can fix this by providing the correct database information in this file.
- Locate your
wp-config.phpfile: This file resides in your server’s root directory.
- Edit the
wp-config.phpfile: Open the file and look for the MySQL settings area. There, you’ll find lines indicating
DB_CHARSET. Ensure these values match your database name, username, password, host, and charset.
- Save your changes: After ensuring the correct information, save and close the
Hopefully, one of the steps outlined in the guide helped you resolve the ‘Your PHP installation appears to be missing the MySQL extension which is required by WordPress‘ error. If the issue remains unresolved, consider reaching out to a WordPress specialist who can assist you in debugging issues further. Remember, every problem has a solution. Happy WordPress-ing!