Skip to content

Fixing "Your PHP installation appears to be missing the MySQL extension"

WordPress shows “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” when PHP can’t talk to your database. It usually appears after a PHP version change, or after moving a very old site.

  1. Log in to cPanel and open Select PHP Version under Software.
  2. Open the Extensions tab.
  3. Make sure mysqli (or nd_mysqli) and mysqlnd are ticked. Also tick pdo_mysql if your site uses it.
  4. Reload your website.

Each PHP version has its own extension list, so check again whenever you change PHP version.

2. Use a PHP version your WordPress supports

Section titled “2. Use a PHP version your WordPress supports”
  • Modern WordPress (6.x) works best on PHP 8.2 to 8.4.
  • Very old WordPress (older than 3.9) uses the old mysql_ functions, which were removed in PHP 7. The error appears on any PHP 7 or 8 version.

For a very old site, update WordPress rather than going back to an old, insecure PHP version. Take a backup first. If you can’t update right away, switch to the PHP version the site used before in Select PHP Version, then plan the update.

See Changing your PHP version and settings.

If the extension is on but the error remains, an old line in .htaccess may be forcing a different PHP version. In File Manager, turn on Show Hidden Files, open .htaccess and remove any AddHandler or SetHandler lines that mention PHP.

Was this page helpful?