Opened your website frontend and saw the “your PHP installation appears to be missing the MySQL extension which is required by WordPress” error message? Although things look grim, don’t panic. Unlike messages that manifest similarly such as s “This site is experiencing technical difficulties“, this one isn’t as tough to figure out with a little troubleshooting. But if you keep your eye on the reward, it should be a walk in the park. So without further ado, here’s how to fix the “your PHP installation appears to be missing the MySQL extension which is required by WordPress” error.
Causes of the “PHP installation missing MySQL extension” error in WordPress
The most common cause of this problem is that the PHP code on your WordPress website is incompatible with the version of PHP your website is using. To be more precise, WordPress changed the default MySQL extension with PHP version 7.0 and later. This upgrade saw a switch to newer extensions named MySQLi or PDO_MySQL. So, either upgrading the PHP version or, if that’s already done, the PHP code itself, will get things synchronized and eliminate the problem.
1. Check the current PHP version
To determine how to proceed, examine the present situation. One way is to access your WordPress Admin Section and then click on Tools > Site Health to see the PHP version at the top. Alternatively, you can do a little work ahead of time to reduce time spent on steps 4 and 5. Follow these steps to find the current version of PHP in WordPress:
- Access your WordPress website using FTP.
- Now, create a new document file in the root folder of your WordPress website, and name it phpinfo.php.
Tip. The root folder is the one that contains a file named wp-config.php. - Open the document file, then paste the following code snippet:
<?php
phpinfo();
?>
- Save changes, then visit your-website.com/phpinfo.php in your browser.
Clarification. Replace “your-website.com” with your actual domain name. - If everything worked, you’ll see a purple-grey table with lots of information.
- Scroll down to the Core section, and at the top of the table, find the PHP Version item.
- Read the numbers in the column next to it, for example, 7.2.34 or 5.6.40, and remember them.
2. Update WordPress core
If your PHP version is 7.0 or above, it means your website’s PHP code is lagging. Getting the two to match will solve the “your PHP installation appears to be missing the MySQL extension which is required by WordPress” error. So, simply update WordPress to the newest version. We also strongly recommend you double-check that your active theme and plugins support the newest WordPress version beforehand. If not, manually upgrade to a slightly older version.
3. Update PHP to 7.0+ version
If you discovered that your PHP version is lower than 7.0, follow this extensive guide on how to update PHP in WordPress. Once again, this will remove any incompatibilities with the PHP code on your website, and the error message should disappear immediately.
4. Verify the MySQL extension is installed
Unfortunately, even if you did everything right so far, there’s still a chance that the MySQL extension isn’t installed. For that reason, you can inspect whether your WordPress website even has a MySQL extension like this:
- Open the phpinfo.php file again.
- Find a section named MySQL or mysqli.
- Check the column right next to the item named Client API library version. It should start with, for example, mysqlnd 5.0.12.
- If you can find what we mentioned, move on to step 5. If you cannot find the section nor the aforementioned row, it means the MySQL extension wasn’t installed. Go to step 6 right away.
5. Check PHP configuration
If you confirmed the installation of the MySQL extension exists, then PHP itself might be the culprit. To investigate whether that’s the case, follow these instructions:
- Open the phpinfo.php file yet again.
- Search for the item named Loaded Configuration File.
- Check the file path in the column next to it. It should end with php.ini.
Tip. if the column mentions a wrong operating system (OS) or has an incorrect file path, move on to step 6 right away. - Follow that file path using FTP, then make a backup of the php.ini file. You can download it to your computer, or rename it to something like php-backup.ini.
- Delete the php.ini file and refresh your website frontend to see if that eliminated the error.
6. Contact hosting Customer Support
Sadly, you might not end up solving the “your PHP installation appears to be missing the MySQL extension which is required by WordPress” error even after all this trouble. Although that’s unlikely after following steps 1-5 to the tee, it’s possible. Luckily, you have 24/7 hosting Customer Service to fall back on. They have the experience, tools, and access to your website files on the server. This will be enough to identify, then fix the problem.