How To Fix “Your PHP Installation Appears To Be Missing The MySQL Extension Which Is Required By WordPress” Error

How To Fix “Your PHP Installation Appears To Be Missing The MySQL Extension Which Is Required By WordPress” Error

Keep up with the latest news, tips and features right here!

How To Fix “Your PHP Installation Appears To Be Missing The MySQL Extension Which Is Required By WordPress” Error

How To Fix Your PHP Installation Appears To Be Missing The MySQL Extension Which Is Required By WordPress Error

Encountering the WordPress error message, “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” can be frustrating. Whether you are installing WordPress on your website or visiting a web page, the error prevents you from accessing and using your WordPress site. This error means that there is something wrong with the code on your site, and this article provides a brief guide on how to fix it.

Causes of “Your PHP Installation Appears to Be Missing the MySQL Extension Which is Required by WordPress” Error

The PHP installation error in WordPress occurs due to issues with the code or scripts on your server.  When you encounter this error, it means that the PHP on your server lacks the necessary extension needed to connect your WordPress site to its MySQL database. Since it can affect the user experience and SEO of your website, it is important to resolve the error as soon as possible. The main causes of the error include:

 Outdated Version of WordPress with PHP 7+: You are more likely to encounter this error if you are using an old WordPress version with a modern PHP version. When this is the case, PHP 7.0 deprecated the MySQL extension for the MySQLi. In other words, PHP 7+ does not contain the MySQL extension that WordPress needs to function properly. The latest versions of WordPress use the newer MySQLi or PDO_MySQL extensions, and if you are using versions below 3.9, you will likely encounter this error.

 Using PHP 5.6 or Lower that is Missing the Extension: When using PHP 5.6 or lower, the extension may be improperly configured or missing, causing the error message.

Steps to Fix “Your PHP Installation Appears to Be Missing the MySQL Extension Which is Required by WordPress” Error

Although hiring a web development consultant is the best way to resolve the error, understanding the process can help in determining what to expect. Here are the 4 main steps to follow:

1. Check the PHP Version You Are Using

The first step to troubleshooting the “Your PHP Installation Appears to Be Missing the MySQL Extension Which is Required by WordPress” WordPress error message is to figure out the PHP version that your WordPress service is running. This will help to determine the steps needed to resolve the error.

If you can still log in to your WordPress dashboard, you can check your PHP version by selecting tools, then site health. WordPress indicates the version you are running on under the Site Health Status.

If you cannot log in to WordPress, you need to connect your website to the server using FTP. The credentials can be found on your web host and an FTP client used to connect. However, you can also use the cPanel File Manager tool to connect to the server. Then, create a new phpinfo.php file in the root directory of your site in the same folder as the wp-config.php file.

Edit the file by adding the snippet “<?php phpinfo(); ?>” and load it in a browser by adding /phpinfo.php to your site’s URL. This will list all PHP settings of your website and the version that is running will be listed at the top. If the version starts with a 7, you will need to update the WordPress software. But if it’s PHP 5.X you will need to verify that the MySQL extension is installed properly.

Pro Tip: Update your site to the latest version of PHP to make it faster and better compatible with themes and plugins.

1. Update WordPress

Newer WordPress versions use MySQLi or PDO_MySQL extensions, which do not cause the error. Your PHP Installation Appears to Be Missing the MySQL Extension Which is Required by WordPress.” If you can still access your WordPress dashboard, you can update it by selecting Updates on the dashboard and clicking Update Now.

If you cannot access the WordPress dashboard, download the latest WordPress .zip file. Then navigate the wp-content folder of your site’s server via FTP. Rename the plugins folder to “plugins.1” to temporarily deactivate all the plugins. Then delete the wp-admin and wp-includes folders. Extract the .zip file and upload new wp-admin and wp-includes to this folder, then upload the other files to your public_html folder to rewrite the existing ones. Rename the “plugins.1” back to “plugins”, and your WordPress is now updated.

2. Update Plugins

Outdated plugins may also cause errors in your WordPress site. If you can still access the WordPress dashboard, check that all plugins are in their latest versions. If not, download the plugins .zip file and upload it to the plugins folder in the wp-content folder.

3. Verify MySQL Extension is Installed

If you are seeing the MySQL extension error and you are running PHP 5.6 or lower, it means that the extension might not be installed. In the phpinfo.php file that you loaded in step 1, find the “Client API library version” row. The four-digit number indicated that MySQL extension is installed.

If you cannot find this row, MySQL extension might not be installed on your WordPress website. You may need to contact your hosting provider to install it for you or update the PHP version so that you will no longer need this extension.

Let an Expert Resolve the MySQL Extension Error

Resolving the resolving the MySQL Extension error can be time-consuming and frustrating. It can also affect the user experience on your site negatively, especially when not acted upon on time. If your site is still showing the “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” error message after following the steps above, contact us for a more tailored solution. The Octopus Tech WordPress website development team will work to identify the issue and resolve any problem your website may be having.