Your PHP installation appears to be missing the MySQL extension which is required by WordPress

WordPress is one of the most widely popular content management system that allows users to better manage their website and publish content easily. Being one of the most commonly used CMS platforms, WordPress has its own set of issues and problems as well. WordPress site showing an error message- Your PHP installation appears to be missing the MySQL extension which is required by WordPress is one such common issue that is encountered by most users. 

This issue occurs when your WordPress site runs with a PHP code that is not compatible with the PHP version that is currently used on your site. Due to this WordPress website may not be able to connect to the MySQL database, due to an outdated MySQL extension. 

For example, if you are using an old version of WordPress (below version 3.9) with a modern PHP version (greater than 7.0), you are most likely to encounter this error. This is because the Modern PHP versions are using newer PDO_MySQL or MySQLi extensions, instead of deprecated MySQL extensions. So this causes Your PHP installation appears to be missing the MySQL extension which is required by WordPress error to occur since PHP doesn’t have the MySQL extension that older versions of WordPress want. 

You should understand what are the major causes of this error, before moving on to discussing the troubleshooting steps to resolve the issue.

You can also follow us on LinkedIn to stay updated on the latest support articles and information we share.

Why “Your PHP Installation Appears to Be Missing the MySQL Extension Error” Occurs?

Generally, the error occur due to any one of the following reasons:

  • Outdated WordPress files

You have to use the updated version of PHP with compatible code to run the WordPress version smoothly without causing any errors. Check if you are running outdated WordPress files and if you find any, fix the problem immediately. This could be one of the reasons that cause the missing MySQL extension error in WordPress.

  • Improper PHP configuration

One of the common causes for this error can be an improper configuration of your PHP extension directory. There may occur a mismatch in your PHP configuration if you have recently migrated your website to any other hosting provider. This will result in showing your PHP installation appears to be missing the MySQL extension error.

  • Error in MySQL extension installation

If you’re still getting the error message Your PHP installation appears to be missing the MySQL extension which is required by WordPress” even after you are having a well-configured WordPress with an updated PHP version, then you have to check if your MySQL extension is installed and enabled correctly or not. There are operating systems that do not come up with a default MySQL extension. Hence you should install it on yourself if you are using an operating system one among them. 

Ways to Fix the Issue

  • Upgrade your WordPress

The issue can appear if you are using an old version of WordPress. If you are using an older version of WordPress, then try Updating your WordPress files and plugins. It will help solve the issue of “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”. WordPress offers automatic updates unless the updations are manually turned off.

Follow the steps to upgrade your WordPress version,

  • Log into your WordPress dashboard “wp-admin” using the admin credentials
  • Select the “Updates” in the upper-left corner to display the available updates.
  • Click “Update Now” to start WordPress updates.

If you are using an upgraded version and still facing the error, you can try to reinstall the current version of your WordPress to fix the issue.

Related Article: How To Solve WordPress 403 Forbidden Error

  • Check the version of PHP you are using

Generally, an outdated PHP version is a common cause of such errors. It is always better to update your PHP version to fix the “your PHP installation appears to be missing the MySQL extension which is required by WordPress” error. Hence, before going to check other functionalities of your WordPress site, you can start by checking your PHP version update.

To check your version, 

  • Connect your website to the server using an FTP with the credentials provided by your host.
  • Create a new file “info.php” in your WordPress root directory. This file should be in the same folder that contains your wp-config.php file. 
  • Open the file using an editor and add the below mentioned line of codes

    <?php
    phpinfo();
    ?>
  • Save the edited file.
  • Now load the file in the browser by typing in the URL “example.com/info.php”, where example.com stands for your domain name.
  • You will now see a long list of details, from which you can find your PHP version.

If your PHP version is anything below 7.0, then you should try updating your PHP version to the latest one. This method will help you fix the issue.

  • Configure the PHP MySQL extension properly

Your PHP installation appears to be missing the MySQL extension which is required by WordPress when you have migrated or updated your website recently. This may cause a mismatch in the PHP configuration in the extension directory (WordPress looks for the PHP data in the extension directory). You can follow either one of the following methods to fix the missing MySQL extension in WordPress error:

Firstly,

  • Navigate to the info.php file that we have created in the previous troubleshooting step.
  • Check the file path value of the “php.ini” file under the “Loaded Configuration File” field.
  • Find the file path value of the “php.ini” file from the info.php. You can find this on the same row of  “Loaded Configuration File”.
  • Now navigate to the location on the server using FTP.
  • Download a copy of the “php.ini” file to your local system.
  • Delete the php.ini file and check if you still face the problem.

If the issue still persists, it is better you get in touch with your web host.

  • Check the MySQL extension installation

To check whether the MySQL extension is installed properly, 

  • Navigate to the info.php file that we have created earlier.
  • Look for a parameter mysql or mysqli.
  • You can see a number next to “Client API Library Version” if the extension installs successfully.

If you are seeing a blank field corresponding to the client API version, it indicates that your MySQL extension is not there for your PHP in the operating system. Not every system has a default MySQL extension. So if you are using one among the operating system that does not have a default extension, it is always better to install one for your own in your operating system. For this, you can get in touch with your host. They will help you install the extension.

Related Article: Error Establishing a Database Connection in WordPress

Summary

WordPress is a reliable and widely using popular content management system due to its user-friendly features. However, there have been instances where WordPress users encounter some errors while trying to access their site. “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” is one such error that many users may encounter. 

With this blog, we are discussing some of the reasons that cause this WordPress error and the possible ways to resolve the issue quickly. If you are finding it challenging to troubleshoot this error, you can get in touch with us. ServerAdminz offers reliable WordPress management services to businesses all over the world at an affordable price. Our WordPress experts are available 24/7 to assist you.