If you are installing WordPress to your server, Sometimes you can see the error ” Your PHP installation appears to be missing the MySQL extension which WordPress requires”.

As any error that occurred during WordPress installation does not provide detailed error information so anyone can recognize the issue of error.

Generally, this error means something wrong happens during the WordPress installation, preventing WordPress from connecting with the MySQL database.

This article will discuss how you can troubleshoot this error and fix the error message easily.

Why WordPress Missing MySQL Extension Error Occur?

Your PHP installation appears to be missing the MySQL extension that WordPress requires. Error is already mentioned in starting the article. An error occurs due to some issue in script/code that prevents connecting with the MySQL database. 

So there are two main reasons behind this error code.

1. Due to an Outdated WordPress Version with PHP7+

If you have the latest PHP version selected and are installing the old version of WordPress, encounter this error. PHP 7 or the latest version deprecated the MySQL extension. THE latest PHP 7+ does not contain the extension for which WordPress is looking.
This problem is occurring in WordPress 3.9 or below version, While the newer version of WordPress uses MySQLi or PDO_MySQL extension.

2. You are using lower PHP version but still extension is missing due to wrong Configuration

Another reason behind this error is if you are using older version of PHP but still getting error because of wrong configuration or extension is missing.

How to Fix Error “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”

Have a look on some tips which will help you to troubleshoot the and fix the error

1. Check the version of PHP you selected

In first step you have to find the what version of PHP you are using on your hosting server. The answer of this question will decide the next step to fix the error.

To check PHP version connect your server via FTP protocol. You can find out your FTP credentials from your hosting provider or from your cPanel account.

You can also use file manager of your hosting.

Once you successfully connected to your FTP or File manager account, create a new file and name it “phpinfo.php” in main directory. The file should be in same directory where wp-config.php file is located.

Now edit the file and put the below code in it.

<?php
phpinfo();
?>

Save and upload it. Now open your web browser and enter the address “http://sitename.com/phpinfo.php”
Don’t forgot to change the sitename.com by you website URL address.

You can see the web page opened having some information about your running PHP version. At the bottom you can see a code like x.x.x Eg. 7.1.0 or 5.7.6

If your PHP version starts with 5.X.X means your MySQL extension is missing while if your PHP version starts with 7.X, that means you need to update your WordPress Software.

2. Update the WordPress Core Files

If you have PHP 7 version running on your server, then the error is causing by old version of your WordPress installation.

To fix the error you can update the WordPress Core files and this way you will also get many advanced features and security updates.

To perform WordPress update, It is highly recommended to take complete backup of your site. Because here we are going to manually do this process.

Now download the updated WordPress files form WordPress.org. You will get a zip file.

Extract it to the new folder and delete the following files form extracted folder.

  • WP-content folder
  • wp-config-sample.php file
  • wp-config.php file

Once you deleted all given files and upload all the remaining files to the root directory of your website via FTP or File manager.

While uploading you will get an error as file already exist. Just press overwrite all files.

Once uploading is done, Just refresh the site URL. You can see your site is running on current version and issue is fixed.

It is also recommended to update your all plugins and themes to the latest version.

3. Check the MySQL installation status

If you are running the old version of PHP (i.e. 5.6), It might be missing of MySQL extension in your running server.

To check the MySQL installation status just go to phpinfo.php file location, Which we created in step 1.

Find the section MySQLi or MySQL field.

If the extension is installed then you can see the Client API library version option with some data.

If you are unable to find out the Client API library version means the extension is missing in your PHP server.

The best fix of this error is to contact with your hosting support team and ask them to install it for you.

4. Check to PHP extension configuration

If you have older PHP version and MySQL is also installed and still you are getting the MySQL extension error means your extension is not configured properly.

Two common issue are

  • Incorrect file path location
  • Php.ini file uploaded which is intended for windows server and you are using in Linux server.

To find the php.ini file location you can refer the phpinfo.php page, Which we created before and just delete the php.ini file.

Now check the problem is resolved and don’t forgot to make backup of your WordPress installation before deleting the php.ini file.

Recommended Theme: FREE DOWNLOAD EXTRA THEME LATEST GPL VERSION {ORIGINAL}

Summary

The Error “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” in encounter because of several technical problums.

As error message is not showing the complete detail of error makes it some tricky.

In this article you can easily troubleshoot the error and fix it. This article will help you for both lower PHP version and Updated PHP version.

If you fixed your error and like the article or still finding any difficulty, let me know in comment box.

Write A Comment