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

In this article, we are going to walk you through the steps to Fix the Error “Your PHP installation seems to be missing the MySQL extension that is needed by WordPress

The error indicates that the WordPress installation is unable to search out the PHP MySQL extension on the server that’s needed for database interactions. The PHP MySQL extension is deprecated and interrupted from PHP version 7.0. These days WordPress uses the PHP MySQLi extension for connecting the databases. Therefore this error means your WordPress installation is incompatible with the PHP version in your cPanel account. During this article, we are going to list out steps that you just will attempt from your side to fix this error.

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

1.In the .htaccess file Check for PHP Handler entries

PHP Handler entries within the .htaccess file may also cause this error on your web site. These recent PHP handler entries existing within the .htaccess file of your web site block your WordPress site from using the right PHP version and extensions configured in the server. Once the migration of your WordPress web site to a new host, it’s quite common to search out these PHP handler entries within the .htaccess file from the old hosting.

For removing the PHP handler entries from the .htaccess file of your website, follow the steps as mention below.

  • In your website’s document root You can find this file.
  • Go to cPanel For finding your website’s document root and click on Domains where you will get the list of your websites.
  • By clicking the directory showing the right side of your domain You can directly open your website’s document root which is listed under the Document Root column.
  • In the directory, navigate to the .htaccess file, choose 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 tend to mentioned above, the PHP MySQL extension has deprecated and interrupted from PHP version 7.0. therefore if you’re 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’ll get the “Your PHP installation seems to be missing the MySQL extension that is needed by WordPress” error. In this case, you would need to update WordPress to the latest version for fixing the difficulty.

3. Using PHP version 5.6 or below

If you’re exploitation PHP 5.6 or below and therefore the MySQL extension isn’t enabled, the positioning can throw the error and in this case, you would required to enable the MySQL extension via PHP selector in your cPanel interface.