WordPress powers more than 40% of websites on the internet. WordPress in turn, runs mainly on PHP, paired with the MYSQL database. However, WordPress users may still face frustrating errors despite its robust features and large community. One such error is “your PHP installation appears to be missing the MySQL extension which is required by WordPress”.
Most users report facing this error message when they attempt to install WordPress. While this error may be frustrating, it is not difficult to resolve.
In this tutorial, we will highlight the major causes of this error. We will then show you simple ways of resolving it.
- What Causes this Error?
- How to Fix the Error Your PHP Installation Appears to Be Missing the MySQL Extension
- 1. Enable MYSQL Extension
- 2. Upgrade the PHP Version
- 3. Update WordPress
- 4. Contact WordPress Experts
What Causes ‘Your PHP installation appears to be missing the MySQL extension which is required by WordPress’ Error?
There are several reasons why WordPress website owners encounter the “your PHP installation appears to be missing the MySQL extension” error. Some common causes of this error in WordPress include:
- A missing MySQL extension: The MySQL extension is a PHP module that must be enabled on your web server. If the MySQL extension is absent, you may encounter this error on your WordPress installation.
- An incompatible PHP version: Another major cause of the error is using an older version of PHP. PHP versions older than 5.6 do not have default support for the updated MySQLi and other newer PHP extensions. Instead, they come with the old MySQL, which WordPress has deprecated in favor of the faster and stable MySQLi.
- Wrong PHP configurations: Another cause of this error is when PHP is not configured correctly. Wrong PHP configuration can involve using a wrong file path or a Windows PHP.ini file on a Linux server. If there is any misconfiguration with your config file, you’ll likely run into this issue.
- An outdated version of WordPress: This error can occur on outdated WordPress websites. If you use a version of WordPress below 4.0 with a 7.0+ PHP version, you will likely encounter this error.
How to Fix the Error Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress
In this section, we’ll explain different ways to resolve this issue on your WordPress website.
Note: If you want to save time and not walk through the troubleshooting steps we’ll cover, consider hiring an expert to help you resolve the issue.
We’ll make some changes to server files. So we recommend backing up your website before proceeding with this tutorial. Our guide also shows how to manually backup WordPress if you don’t have access to the admin panel.
1. Enable MySQL Extension
One of the major causes of the error is the absence of the MySQL extension. If you use WordPress older than version 5.4 and PHP 5.6 or below, you need to enable WordPress MySQL on your server. To begin, you must verify that the PHP extension is enabled and configured properly.
How to Check For MySQL Extension Installation in PHP?
You can check if the MySQL extension is enabled in two ways: from your WordPress dashboard or using a PHPinfo file.
Check For MySQL From the WordPress Admin Dashboard
To check if you have the WordPress MySQL extension, follow the steps below.
First, log in to your WordPress admin area, navigate to Tools >> Site Health, and click on the Info tab.
Next, click the Database dropdown menu. If you see ‘MySQL’ or ‘MySQLi’ next to ‘Extension’, the PHP MySQL or MySQLi extension is enabled on your site.
If you do not see MySQL or MySQLi, it means the extension is missing on your WordPress software.
Sidenote: PHP MySQL extension was deprecated and is no longer actively maintained. We recommend upgrading to MySQLi, which is secure and reliable.
Check For MySQL by Creating a PHPInfo File
If the error prevents you from accessing your site’s backend, you can check for MySQL on your server by creating a phpinfo.php file. You should create this file in the root directory containing your website files.
To do that, you’ll need to access your site files via cPanel or with an FTP client like FileZilla.
For this guide, we’ll use cPanel to access the site files. To start, log in to your cPanel and select the File Manager option.
Next, navigate into the root directory containing your website files (usually the public_html folder). Within this directory, click the + File option to create a new file. Set the filename as ‘phpinfo.php’.
After creating the file, right-click on it and select Edit.
Then copy and paste the code snippet below into the file and save your changes.
<?php phpinfo(); ?>
Next, open the file in your browser using the format ‘websitename.com/phpinfo.php’. Make sure you replace ‘websitename.com’ with your site’s domain.
Once the page opens, scroll down to the MySQL section and check if it is present and enabled.
How to Enable MySQL Extension PHP
After following the steps above, you’ll know if MySQL is enabled on your site. Otherwise, you’ll need to enable the extension from your web server.
To enable the MySQL extension on your website, you will have to log in to the web hosting dashboard. For this tutorial, we’ll use cPanel; however, the process is similar for most hosting providers.
First, log in to cPanel. When logged in, type ‘php’ into the search box, and then click Select PHP Version.
On the ‘PHP Selector’ page, scroll down and tick the mysql and mysqli checkboxes.
After that, scroll up and click on Apply to save your changes.
This should enable the extension on your site and fix your issue.
If enabling the MySQL extension doesn’t resolve the issue on your website, you may need to update your version of PHP.
2. Upgrade the PHP Version
An outdated version of PHP doesn’t contain the latest additions, such as the new MySQLi database. This can cause conflicts and trigger this error.
If you are using a PHP version below 5.6, upgrading your PHP version may fix the error you are facing.
You can check your PHP version from the PHP Selector page on cPanel.
Before updating the version, ensure it is compatible with your existing WordPress version.
You can use this PHP compatibility checker tool to check if your current WordPress version supports the latest version of PHP.
Upgrading Your Version of PHP
To upgrade your PHP version, open the PHP Selector page.
Next, click on your current version to see the list of available PHP versions. Once open, select the latest version from the dropdown.
After that, click Apply to save your changes.
Upgrading your PHP version should resolve the ‘Your PHP installation appears to be missing the MySQL extension which is required by WordPress’ error. If it still doesn’t work for you, consider updating your WordPress version.
3. Update Your WordPress Version
Updating your WordPress core version is another way to solve the error. If you have tried enabling the MySQL extension and updated your PHP version but still face this error, the cause of the error may be compatibility issues with WordPress.
When you update WordPress, it comes with an updated code base that usually solves compatibility issues with MySQL extensions.
While there are many ways to update your WordPress installation, the easiest and most recommended method is to update it from your WordPress dashboard.
Note: If the error is preventing you from accessing the WordPress admin area, you may need to update WordPress manually. Please check our guide for more information.
To update your WordPress version, log in to the WP admin area and then go to Dashboard >> Updates.
You’ll see an update button if there’s a newer version of WordPress available to upgrade to. Click on this button.
WordPress will automatically update your site to the latest version. Version 6.2 is the latest version of WordPress at the time of writing.
Further, using outdated themes and plugins can trigger errors such as the missing MySQL extension error. It can also pose a security risk to your website.
Updating your WordPress themes and plugins is important in order to ensure your WordPress website runs smoothly and securely.
To update your plugins, scroll down to the ‘Plugins’ section of the ‘Updates’ page and tick the Select All checkbox. After that, click Update Plugins to update your plugins.
Scroll down to the ‘Themes’ section and follow the same procedure to update your installed themes.
4. Contact WordPress Experts
If you have tried all the steps above with no success, you may need to hire an expert to help you resolve the issue on your site.
Fortunately, our team of WordPress experts are ready to jump in and troubleshoot any issue you are facing on your WordPress site.
Benefits of Using A Professional WordPress Support Service
Website owners gain many benefits when they outsource their WordPress support needs to experts. Here are a few benefits:
Time-saving: Outsourcing your WordPress support needs gives you more time to grow your online business. It is particularly helpful for users who lack the time and aren’t tech-savvy.
Professional assistance: Popular WordPress services such as Fixrunner have tested and trusted experts that provide world-class support.
Safe, Secure, and Personalized: Professional WordPress support is safe and secure because professional developers handle your issues. If you want a personalized, safe, secure experience, subscribe to a professional WordPress service.
Conclusion on Fixing ‘Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress’
Although ‘your PHP installation appears to be missing the MySQL extension, which is required by WordPress’ error can be frustrating, it is not a dead end.
In this post, we have shown you how to troubleshoot this error and get your website working again.
The solution can be as easy as updating your WordPress and PHP versions or enabling the MySQL extension on your host server.