Skip to main content

How to Fix: "Your PHP Installation Appears to be Missing the MySQL Extension Which is Required by WordPress

If you're seeing the error message:
"Your PHP installation appears to be missing the MySQL extension which is required by WordPress",
it typically means your web server doesn't have the necessary PHP extension enabled to communicate with a MySQL database.

phpapp.JPG

This guide explains why this happens and how to fix it.

Why This Error Occurs

This error is usually due to one of the following:

  • PHP was compiled without MySQL support.
  • The MySQL extension is missing or not enabled.
  • You're using a newer version of PHP (7.0+) where the mysql extension is deprecated and replaced with mysqli or PDO_MySQL.
  • Incorrect or incompatible PHP version with your WordPress installation.

Step-by-Step Fix

1. Log into Your cPanel Account

Use the login URL provided by your hosting provider (e.g., yourdomain.com/cpanel).

2. Check or Change Your PHP Version

Look for "Select PHP Version" or "MultiPHP Manager" (names vary by host).

If available, click on it.

Ensure you're using a PHP version compatible with WordPress (PHP 7.4 or later is recommended).

If you're on PHP 5.x or something incompatible, switch to a newer version.

phpv.JPG


3. Enable MySQL Extensions

In the "Select PHP Version" or "PHP Extensions" screen:

Look for and enable the following:

mysqli

pdo_mysql

Check the box next to each if they are not already enabled.

Click Save or Apply if needed.

phpv1.JPG


4. Verify the Changes

You can check if the extension is now active by creating a temporary phpinfo.php file:

Go to File Manager in cPanel.

Navigate to your site’s root directory (often public_html).

Create a new file named phpinfo.php.

Add this code:

<?php phpinfo(); ?>

Visit https://yourdomain.com/phpinfo.php in your browser.

Search (Ctrl+F) for mysqli or pdo_mysql.

If it’s listed, the extension is now active.

Don’t forget to delete the phpinfo.php file after you're done — it exposes sensitive server configuration details.

5. Clear Cache and Retry

If you’re using a caching plugin or Cloudflare, clear the cache.

Reload your site. The error should now be gone.

What If You Don't See “Select PHP Version”?

If your cPanel doesn’t offer PHP extension management:

Contact your hosting provider and ask them to enable mysqli or pdo_mysql.

Most shared hosting plans support this request without needing root access.