How to Fix WordPress Error Missing MySQL Extension Problem

Do you try to install WordPress or visit your WordPress site only to encounter an error that says “Your PHP installation seems to be missing the MySQL extension that is required by WordPress”?

As with any WordPress error message, it can be frustrating to encounter an issue that prevents you from using/accessing your WordPress site.

However, don’t despair!

Generally, this error means that something is wrong with the code on your site and something is preventing WordPress from being able to connect to your MySQL database.

In this article, we’ll go over what that “something” might be and share some tips on how to fix and fix this error message.

What causes the missing MySQL extension error in WordPress?

As we mentioned in the introduction, the error message “Your PHP installation seems to be missing the MySQL extension that is required by WordPress” is due to some problem with the code/scripts on your server.

Specifically, this error means that the PHP on your server does not have the extension needed to connect your WordPress site to your MySQL database.

There are two main reasons why this might be the case:

1. If

you are using a very old version of WordPress with a modern version of PHP, you might encounter this error because PHP 7.0 made the MySQL extension obsolete in favor of MySQLi. That is, PHP 7+ no longer includes the MySQL extension that WordPress is looking for.

Modern versions of WordPress will use the newer PDO_MySQL or MySQLi extensions. However, older versions of WordPress (below version 3.9) can cause this problem.

2. You are using PHP 5.6 or earlier but the extension is missing or configured incorrectly

The other likely cause is that you are using PHP 5.6 (before the MySQL extension became obsolete), but the extension is missing or configured incorrectly

. If you’ve ever seen this 👇 error, then you know how frustrating it is to not be able to access your site.

Fortunately, resolving this is a quick fix. 💥 Click below to see the full tutorial! Click To Tweet

How to Fix “Your PHP installation seems to be missing the MySQL extension that is required by WordPress”

Now that you know what’s going on, let’s go over some tips on how to fix and fix the problem

.

1. Check

which version of PHP you are using

The first step in diagnosing this problem is to find out which version of PHP your WordPress site’s server is running. The answer to this question will dictate the next steps you take.

To verify this, connect to your WordPress site’s server using FTP. You can get your FTP credentials from your web host and you’ll also need an FTP client to connect.

If your host is using cPanel, you can use the cPanel File Manager tool.

Once you’ve connected to your server, create a new file called phpinfo.php in the root directory of your WordPress site. This should be the same folder that contains your wp-config.php file.

Then, edit the file and

add the following code snippet:

<?php phpinfo(); ?>

Once you save the file (and reload the saved version if necessary), navigate to yoursite.com/phpinfo.php, making sure to replace yoursite.com with your actual domain name

.

You should see a screen that shows a lot of different information about the PHP settings on your server. Scroll down to the Core section and find the PHP Version item. Pay attention to the numbers: you should see something like x.x.x. For example, 7.2.25 or 5.6.8:

<img src="https://kinsta.com/wp-content/uploads/2020/08/missing-php-extension-wordpress-1-1024×490.jpg" alt="How to check WordPress PHP version

” />
How to check the PHP version of your WordPress site If your PHP version

it starts with a “7”, that usually means you need to update the WordPress software. On the other hand, if you are still using PHP 5.X, you may be missing the MySQL extension.

Note: At Kinsta, we strongly recommend using the latest version of PHP. In fact, we do not support versions earlier than PHP 8.0. These older versions perform slower, and because they no longer receive security updates, they could pose a security risk to your site.

Learn more about why it’s important to use modern, compatible versions of PHP.

2. Update the main WordPress software

If your server is using PHP 7+, the most likely cause of this error is that you are running an older version of WordPress. If you are using WordPress version 3.9 or lower, that can trigger this error.

So, the solution is to update your WordPress software, which will also come with many other features, security, and performance improvements.

To manually update your WordPress version, first, make sure you have a backed up version of your site. Then, go to WordPress.org and download the latest copy of the WordPress software.

Once you have downloaded it, extract the zip file to your computer. Then, open the folder containing all WordPress files and delete the following items:

The wp-config-sample.php.

    The

  • wp-config.php file (you may not see this file, just be sure to delete it if it’s there). The wp-content folder
  • .

Once you have deleted those items, upload the remaining files/folders to your server via FTP. When your FTP client asks you about duplicate files, tell it to overwrite all

files:

How to reinstall WordPress software
Reinstall WordPress by overwriting existing files

Once the file uploads are finished, your WordPress site should be running the latest version and your problem should be fixed.

As a follow-up step, you should also make sure that you update all your plugins and themes to the latest versions. You can follow these guides:

How to Update WordPress

    Plugins

  • How to Update
  • WordPress
  • Themes

3. Check

if the MySQL extension is installed If your server

is still using PHP 5.6 or lower, your server may be missing

the MySQL extension that WordPress requires.

To check if this is the case, go back to the phpinfo.php file you uploaded to your server in Step #1

.

Look for a section called mysql or mysqli.

If the MySQL extension is installed

, you should see a version number next to the Client API Library Version item:

<img src="https://kinsta.com/wp-content/uploads/2020/08/missing-php-extension-wordpress-3-1024×488.jpg" alt="How to see if the WordPress MySQL extension is

installed” />
How to see if the WordPress MySQL extension is installed

If you can’t find this information, that means the MySQL extension is not installed. The best solution is usually to contact your host’s support staff and ask them to install it for you.

Note: Again, we strongly recommend not using PHP versions earlier than 8.0 because they no longer receive security updates and do not work as well as newer versions.

Unless you must continue to use PHP 7.4 or lower, a much better solution is to upgrade your server to PHP 8+ rather than spending time properly configuring an older version of PHP. You can follow our guide on how to update the PHP version of your WordPress site and how to install PHP on any server.

4. Make sure

the PHP extension is configured correctly

If you are using PHP 5.6 or lower and the extension is installed, the problem may be that it is not configured correctly. Two common problems are:

Loading a

  • php.ini file intended for Windows servers when using a Linux server
  • Incorrect file paths.

You can find the location of your php.ini file in the

phpinfo file.php which you created before: How to find the path of the WordPress php.ini fileHow to find the path of the

WordPress php.ini file First, we recommend backing up the existing file by downloading it to your local computer. Then, try deleting the php.ini file and see if that fixes the problem.

Summary

The message “Your PHP installation seems to

be missing the MySQL extension that is required by WordPress” is a frustrating error to find because it looks so technical

.

However, with the steps in this article, you should be able to diagnose and fix the problem

.

Our recommended solution is to make sure you are using the latest versions of PHP and WordPress.

If you use PHP 8+ and WordPress 5.0+, you should be able to automatically fix this error and get your site up and running again, while benefiting from all the other performance, security, and feature improvements that come from the update.