aThemeArt

Resolving the “PHP Installation Appears to Be Missing the MySQL Extension Required by WordPress”

It’s no doubt WordPress is a reliable and robust platform for managing your website. Despite this, it’s hampered with few errors that might be frustrating, especially if you’re a newbie. One of the most notorious error messages you might encounter is,

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

When you encounter the message, it might be frustrating; however, there are simple steps you can follow to solve the problem. In this blog post, we’ll explore what the error message means, its potential causes, and how to resolve it.

Let’s roll our sleeves and get this done. Shall we?

What causes this error?

For websites to run without problems, it is always essential to ensure that you update your WordPress and PHH core versions at all times.

This not only optimizes the website’s performance but is also critical to your web’s security. So, if your website from malicious people, keeping your core PHP version and needs to be cleared plugins updated is critical.

So, what happens when you have an outdated PHP version?

Older PHP versions use MySQL extensions to connect WordPress to MySQL databases. However, newer WP versions are using MySQLi and depreciating the use of MySQL extensions.

So, when your PHP is outdated, you’ll need to use a MySQL extension missing from your WordPress core. Alternatively, you could not have installed, enabled, or correctly configured your PHP extensions.

On the other hand, if your PHP version is up to date, then the problem lies with your WPcore.

So, when you see the error, “Your PHP installation appears to be missing the MySQL Extension Which Is Required by WP,” it means that your PHP installation on the server does not have the right MySQL extension to connect your WP core to the server’s database.

In simpler terms, your WP version is not compatible with the PHP version you are using.

Step by step guide to resolving Missing MySQL Extensions on WordPress

Do not be fazed by the error “Your PHP installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress” error is quite simple to solve if you have the proper guidelines.
The error just means that something is wrong, and you can always rectify that. We can derive several methods to fix this error from what we have found to be the error causes.

Pre-requisites you Need to Fix the Error

To fix the missing MySQL extension problem, you need your website login credential. However, if the issue requires delving into the website files, then the following will be necessary.

  • Administratorprivilege/access to your server.
  • A secure SFTP (secure File Transfer Protocol) client. For this, we recommend using FileZilla or Cyberduck.
  • Code editor. You would opt to use the code editor provided by your host. However, if you require an additional code editor, then you can use Atom editor.

 With all the assets ready, follow the steps below;

 Checking and Updating Your PHP Version

A common cause of this problem is using the wrong PHP version on your WordPress. So, the first time you see this error, instinctively, you should check on the version you are using.
The answer to what version your WP server is running on will dictate the following action.

 To check for the version:

  • Connect to your server using an FTP, a file transfer protocol, which you can get from your web host.
  • Get an FTP client to connect (the right client will work on your operating system, and easy to use and help sort out folders) 
    Note that if your web host uses cPanel, you can access your server using the cPanel File Manager tool, which is safer and more straightforward for resolving the error yourself.
  • Once you connected to the servers, create a new folder and name it phpinfo.php file in the WordPress site’s root directory. Make sure you can see your wp-config.php file on the same folder.

 Next, click on the edit folder option and insert the following code:

<?php  
  phpinfo (); 
?>
  • Save the file and re-upload the new version.
  • Go to yoursite.com/phpinfo.php and put in your actual domain name on yoursite.com
  • When a pop-up screen appears, scroll down to the CORE section and look up any PHP version items. 

If the numbers on the PHP extension start with a ‘7.2.x.x…’, then your PHP is up to date, and the problem might be in your WordPress core.
If not, and say it starts with 5, you’ll need to update the PHP version.

Updating the WordPress Core Software

 If you realize that your PHP extensions are ok, then the problem lies in the WordPress core, and you will need an update.
WordPress version 3.9 and lower are common triggers to this error.
Quick Fix:

  • First, confirm you have a backed-up version of your website to avoid data loss.
  • Then download the latest versions of the software from WordPress.org
  • The download comes in a ZIP folder, which you should extract to another folder on your computer.
  • Once you open the extracted folder, delete thewp-config-sample.phpand wp-config.php files and thewp-content folder
  • Then, upload the remaining files to your server using TFP, and authorize an overwrite of existing files when prompted

 Along the way, make sure you are updating your themes & plugins to the latest versions too.

Installing a MySQL Extension

Sometimes, you have the latest WordPress version but still, experience problems connecting to your server.
This could happen if you fail to install a MySQL extension to your server.
To check for MySQL extensions;
Go to phpinfo.php on your server as described in step 1
Search for mysqlormysqli section
If there is an extension, you will see its version number next to the Client API Library Version item under Mysqli Support. 
If you cannot find said information, then it means that you don’t have MySQL extension.
To resolve this, talk to your web host service provider and request assistance installing one.

Configure Your Extensions Properly.

Now, if everything else is ok, your WordPress software is up to date, and you have your MySQL extensions installed but still experience the same error, then it means you might have the wrong PHP configuration.

 Potential causes:

  • Installing the extensions using incorrect path files, which means that your MySQL extensions are in the wrong directory

 To check for installation location;

  • Go to the phpinfo page
  • Look for loaded configuration file (shows the file path of the PHP configuration path)
  • Check theextension_dirinformation to see if the path listed there matches the path in the php.ini file.

If these two paths do not match, then you can safely conclude that your PHP extensions are in the wrong place.

  • Using incompatible operating systems, like using PHP extensions meant for Windows on Linux.

 To correctly configure your PHP extensions;

  • Start by going to the phpinfo.php file as described before.
  • Then, backup your files.
  • Delete the misconfigured    php.ini    file
  • Download a new copy
  • Install it & run your WP to see if that fixes the problem

Final Thoughts

Anytime you see a “Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress” error on your website, the problem could either in your PHP extensions or with the version of WordPress you use or you may check Common WordPress Errors.

And to ensure you do not encounter similar problems, always make sure you have the latest WordPress software and PHP versions installed.

Rectifying the error is simple, but also take care to avoid deleting data from your website. And if you feel that it is too much of a risk, you can always contact your web host support for help.

Inspire us with your love!

FacebookTwitterReddit
Calvince

Passionate and industrious tech writer with a bachelor's in information technology. Skilled in WordPress, HTML, and server-side scripting. Expert in content writing, keyword research, and copywriting. Available on Fiverr, Upwork, Craigslist, and Codeable.

You can check also

Take a look! how reaching out the post

    Avatar
    coding young
    August 10, 2021 at 4:08 am

    You have to enter the commands on command line. You need to connect to your server through SSH using an SSH client. Log in with a user that has root privileges.

Comments are closed.