Fortunately, WordPress errors aren’t a regular occurrence for most users. For those that do crop up regularly, there’s usually a fix to be found. However, if you come across Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress, you may be scratching your head for a while.
This is because there is no obvious repair you can make based on the error. What’s more, everything else may seem fine on your site in some cases. The good news is that solving this problem could take minutes at most.
This post will look at the ‘missing MySQL Extension’ error, discuss why it appears, and more importantly, show you how to fix it.
As WordPress errors go, Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress is the biggest mouthful of them all. It’s something you’ll notice upon logging into the WordPress dashboard in most cases, and it isn’t something you’ll immediately understand.
Essentially, it means the PHP code that runs WordPress on your server is missing a vital part. Alternatively, the MySQL extension could be present, but your server’s PHP version might not be able to tell from reading the code on your site.
For the uninitiated, your WordPress database contains practically everything on your site. The Content Management System (CMS) shuttles data to and from your database in perpetuity – MySQL is the type of database WordPress runs on.
Putting everything together, you start to see the real issue. In layman’s terms, the server doesn’t know how to talk to your database, because something is missing, or incompatible. Usually, this happens for two reasons:
In any case, once your server and WordPress align, all will be right with the world.
In order to fix the missing MySQL extension error, you shouldn’t need much more than your site’s login credentials. However, if you have to delve into your site’s file, the following will be essential:
Once you have these to hand, you’re ready. However, you might not need them all. Our advice is to grab them if you get to step two below.
If you don’t fancy working under the hood of your WordPress installation, the error is often fixed before this stage. Here are the three steps you can take to solve the issue:
The hope is that the first step will resolve the error. As such, let’s look at this step first.
First up is an easy solution that will take about two clicks. Head to the Dashboard > Updates screen within the WordPress back end, and see if there are any core updates to apply:
If there are, click the button to install them. Once WordPress has finished, check for the error again. If there’s no error, mop your brow and pour yourself a well-earned drink.
To stop this appearing in the future, remember to apply WordPress updates on a frequent basis, and/or keep up to date with the PHP version on your server.
However, if you still see the error – or if WordPress is up to date – you’ll have work to do under the hood.
From this point on, you’ll be working within WordPress’ core files. As such, make sure you carry out a clean backup first.
When you’re ready, crack open your text editor, and enter the following:
<?php phpinfo(); ?>
Save this file as info.php. Next, log into your site using SFTP with the credentials from your account’s dashboard. You should see a list of your site’s files:
Note that if you run more than one site, there will be multiple folders here. There will be one site within the primary public_html or www folder. Your other sites will often be in a directory with the same name as the site in question.
Next, upload the info.php file to your server. Often you can just drag and drop the file itself. Then, head to example.com/info.php (replacing the placeholder with your domain). Here, you’ll see a page full of diagnostics:
This contains details on your server’s PHP configuration. However, the part you need is the PHP Version entry in the Core section:
If the number here begins with a 7, and a WordPress update hasn’t resolved the issue, our advice is to contact your host. There could be something going on that requires expert eyes.
If the other resolutions haven’t worked, this likely means you have an old version of PHP. However, you could also be missing the MySQL extension named in the error. Here’s how to resolve it.
For this step, head back to your example.com/info.php file. Again, you’ll want to replace the placeholder domain with your own. This time, look for the mysqli or mysql section:
The MySQL extension is installed if you can see a number next to the Client API library version field. If not, you’ll need to contact your host. The solution is often to update your PHP version – this is something your host may need to do on this occasion.
If your MySQL extension is present, the final step is to check its configuration. Often, your php.ini file will either be for the wrong Operating System (OS), or have the wrong file path.
The quickest way to reconfigure the file is to remove it from your server. Head back to your site’s info.php file, and check the path under the Loaded Configuration File field:
Next, head to the location in your server – you’ll want to use SFTP again. From here, drag the file to your computer to back it up. Finally, delete the file from the server.
Finally, navigate to the front end of your site to check everything is working, then look at the back end for the error. If it’s gone, you can celebrate. If not, we suggest contacting your host, as they will need to diagnose the issue further.
Most WordPress errors have the same standard fixes. However, Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress is a tricky one because of the nature of the issue.
This post has looked at three steps to fix the error. Let’s recap:
Is this an error you’ve come across before? If so, was there a fix that we haven’t included here? Let us know in the comments section below!
SeedProd is one of the elders of the WordPress ecosystem. It's also a bit of…
Really Simple Syndication (RSS) feeds are a vital component of the WordPress ecosystem. They act…
It’s that time of year again when people start revving up their shopping lists, hunting…
Forget music being the food of love, WordPress has a love for food. You can…
If you clicked on this post, I’m guessing you want to find the best solution…
Trying to figure out how to start an online course so that you can share…