“Your PHP installation appears to be missing the MySQL extension which is required by WordPress”: the fix

By CompatNav · Published · Last reviewed · 3 min read

Short answer

WordPress talks to its database through a PHP extension called mysqli. When the PHP version your site runs doesn’t have it switched on, WordPress can’t start: it shows a page titled “Requirements Not Met” with this message, and answers with an HTTP 500 error. It shows up after a change of PHP version or server when the new PHP comes without the extensions the old one had. Fix: enable mysqli for that PHP version in your hosting panel, or ask your host; on your own server, install or enable the extension for the PHP version the web server uses. Nothing in your database or files is lost.

What you see

Instead of your site, and instead of the admin area, WordPress shows a short page. We reproduced it with WordPress 7.1.2 on the official PHP 8.4.26 build, with mysqli left out:

Browser · WordPress 7.1.2 on PHP 8.4.26 without mysqli, our test; the page’s text, answered with HTTP status 500

Requirements Not Met

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

Please check that the mysqli PHP extension is installed and enabled.

If you are unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress support forums.

The text comes from WordPress’s own check, which runs at the very start of every request (WordPress 7.1.2 source). WordPress skips it only when a db.php drop-in in wp-content provides its own database layer.

Why it happens

PHP is installed per version: PHP 8.3 and PHP 8.4 on the same server each have their own list of enabled extensions. When a site moves to another PHP version, or another server, it gets that version’s list. If mysqli isn’t on it, WordPress stops here.

WordPress’s hosting handbook lists mysqli with json and hash under the extensions that are, in its words, “required for a WordPress site to work” (make.wordpress.org).

Fix it

On managed or shared hosting

  1. Open your hosting panel’s PHP settings, where you chose the PHP version. Many panels list the extensions of each version with a checkbox.
  2. Enable mysqli for the version your site uses now, and save.
  3. No such setting? Ask your host to enable mysqli for your site’s PHP version. Or, for now, switch back to the version that worked (how to downgrade PHP).
  4. Reload the site. WordPress checks again on every request, so it works at once.

On your own server

Install or enable the mysqli extension for the PHP version the web server uses (not only the command line), then restart PHP or the web server. The exact package and file names depend on your operating system and how PHP was installed.

Once the site is back

Open Tools → Site Health: it checks a longer list of extensions and flags the ones still missing (“One or more required modules are missing”). A related message from the same check: WordPress requires the json PHP extension.

If the PHP change was an upgrade, check your plugins and theme for it too: a missing extension is the server’s side of an upgrade, code that no longer runs is the other. CompatNav, a free plugin on wordpress.org, reads every plugin and theme on your server for the PHP version you choose (8.0 to 8.5). Other ways an upgrade can stop a site: WordPress not working after a PHP upgrade.

Key takeaways

  • WordPress needs PHP’s mysqli extension to reach its database; without it, it stops before loading anything.
  • The page is titled “Requirements Not Met” and comes with HTTP status 500.
  • It shows up after a change of PHP version or server, when the new PHP lacks the extensions the old one had.
  • Fix: enable mysqli for the PHP version the site uses, in the hosting panel or through your host.
  • Your content is safe: the database is untouched, WordPress just can’t reach it yet.

Frequently asked questions

Is my database gone?

No. The message appears before WordPress even tries to connect. The database and your files are unchanged; once mysqli is enabled, the site comes back as it was.

I enabled mysqli and it still shows. Why?

Usually the extension was enabled for a different PHP version than the one the site uses, or for the command line instead of the web server. Check which PHP version the site runs in your hosting panel and enable it there, or ask your host to check.

Does a plugin cause this?

No. WordPress checks for the extension before it loads any plugin or theme. The only exception is a db.php database drop-in in wp-content, which replaces WordPress’s own database layer.

Check your own site before you upgrade

CompatNav is a free WordPress plugin. It reads the code of your plugins and themes on your own server and tells you, in plain words, what will break and what will only show notices on the PHP version you choose. It never changes your code. It can’t see problems that only appear while code runs with real data, so a quick check of your site after the upgrade still matters.

Get CompatNav on wordpress.org How it works

Sources

About the code examples: each output is the real output of the code shown, run with the official PHP builds, without a php.ini, with all errors reported and displayed. Only the file path was replaced by a neutral server path.