How to Fix “Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress” Error
When you try to install word press or after installed word press while visiting you site encounter an error that says “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”?
This word press error message can be so annoying and frustrating to encounter a problem that prevents you from using/accessing your WordPress site.
However,don’t despair!
Generally this error says that something is going wrong with the code on your site and something is preventing WordPress from being able to connect to its MySQL database. More specifically it can include that:
- Your wordpress files are outdated or using older version of word press
- The Mysql extension isn’t enabled or installed
- The php extension is not configured properly
How to fix “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”
1. Update Your WordPress Installation
The first and easy way to fix this error is to upgrade word press to the most recent version (5.7.2).It seems if you have installed word press via cpanel using softaculous ,upgrade there in 2 steps. Open cpanel >>Softaculous >>upgrade
Before upgrade new version make sure take backup of your wordpress source code and than start the process.
You can upgrade this in your wordpress dashboard also,
2.Make sure Mysql extension isn’t enabled or installed.
Only updating wordpress version doesn’t work next step is to verify whether the Mysql extension is installed and enabled.Most of the operating systems don’t include the MySQL extension by default. If you’re using one of them, you’ll need to install it yourself.
Now you need to create a phpinfo.php file in the root directory (public.html) of your WordPress site via FTP or using cpanel file manger. It should contain the following:
Save your file, then visit it in your browser (https://www.yourdomain.com/info.php). You’ll see a page with the details of your PHP installation.
Look for the mysql or mysqli section. If the extension is installed, it will display the version next to Client API:
If it is blank than,the extension is not installed.Next you have to install it and it vary depends on your domain hosting and systems.
If you host uses cpanel ,than you can enable the MySQL extension by clicking on Select PHP Version under Software:
After choosing the most recent PHP version, tick the boxes for “mysqli” and/or “mysqlnd”. Save your changes, then refresh your site to see if the error is resolved.
3.Verify the php extension is not configured properly
In some cases, PHP won’t be able to access the MySQL extension because its path isn’t set correctly. To see if that’s the case, return to yourdomain.com/info.php, and this time look for the Loaded Configuration File field:
Take note of that file’s path. Now scroll down and look for the extension_dir field, and check its value:
The entry should match the Loaded Configuration File path. In the above example, you’ll notice that it displays the correct extension directory path for the PHP version. However, if yours is pointing to the incorrect location, you’ll need to edit your php.ini file to replace it with the correct one.
Conclusion:-
Error“Your PHP installation appears to be missing the MySQL extension which is required by WordPress” message is a frustrating error to encounter because it seems so technical.
I believe the above steps in this article, you should be able to diagnose and fix the issue.
Our recommended solution is to make sure you’re using the most recent versions of both PHP and WordPress.
If you use PHP 7.2+ and WordPress 5.0+, you should be able to automatically fix this error and get your site working again, while also benefiting from all of the other performance, security, and feature enhancements that come from updating.
To know about How to configure WP to use a Remote Database click here.