In this guide, we will walk you through the steps to Fix the Error “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”
The error indicates that the WordPress installation is unable to find the PHP MySQL extension on the server that is required for database interactions. The PHP MySQL extension is deprecated and discontinued from PHP version 7.0. Nowadays WordPress uses the PHP MySQLi extension for connecting the databases. So this error means that your WordPress installation is incompatible with the PHP version in your cPanel account. In this guide, we will list out steps that you can try from your side to fix this error.
1.Check for PHP Handler entries in the .htaccess file
PHP Handler entries in the .htaccess file can also cause this error on your website. These old PHP handler entries existing in the .htaccess file of your website block your WordPress site from using the correct PHP version and extensions configured in the server. After the migration of your WordPress site to a new host, it is very common to find these PHP handler entries in the .htaccess file from the old hosting.
Example for a PHP handler entry:
# php – BEGIN cPanel-generated handler, do not edit # Set the “ea-php72” package as the default “PHP” programming language. <IfModule mime_module> AddHandler application/x-httpd-ea-php72 .php .php7 .phtml </IfModule> # php – END cPanel-generated handler, do not edit
For removing the PHP handler entries from the .htaccess file of your website, follow the below steps.
- You can find this file in your website’s document root.
- For finding your website’s document root go to cPanel and click on Domains where you will get the list of your websites.
- You can directly open your website’s document root by clicking the directory showing the right side of your domain which is listed under the Document Root column.
- In the directory, locate the .htaccess file, select it and click on Edit that will open a window where you can modify the file contains.
If the issue is not fixed by removing the PHP handler entries in the .htaccess file under the document root of your website, you may also need to check for other .htaccess files in the public_html or in the home directory.
2. Older WordPress versions conflicts with PHP 7.0+ versions
As we mentioned above, the PHP MySQL extension has deprecated and discontinued from PHP version 7.0. So if you are using an older version of WordPress (that is compatible with the older versions of PHP, 5.6 or below) with PHP 7.0+ versions, you will get the “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” error. In this case, you need to update WordPress to the latest version for fixing the issue.
3. Using PHP version 5.6 or below
If you are using PHP 5.6 or below and the MySQL extension is not enabled, the site will throw the error and in that case, you need to enable the MySQL extension via PHP selector in your cPanel interface.
Congratulations! You have now learned how to fix the “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” error.If the steps above listed in this article do not resolve your issue, please feel free to open a support ticket and we’d be happy to take a look.
Our Guiding Principles
- Provide consistent, stable and reliable web hosting services.
- Ensure rapid ticket response and quick resolutions to issues.
- Never saturate or over-provision servers to ensure stability and speed for our customers.
- Use only high quality enterprise-class hardware to ensure minimal downtime from hardware failures.
- Provide clear pricing with no hidden fees or gotchas.