Home » wp-includes » Your PHP Installation Appears to Be Missing the MySQL Extension

Your PHP Installation Appears to Be Missing the MySQL Extension

You open your WordPress site and instead of the homepage you get a “Requirements Not Met” page with this text:

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.

Both the frontend and wp-admin are down. Your database and files are fine. WordPress stops before it even tries to connect, because the PHP version serving the site cannot talk to MySQL or MariaDB.

This shows up most often right after a PHP version change: the host upgraded PHP, you picked a newer version in the control panel, or you moved the site to a fresh server. The new PHP build simply does not have mysqli loaded yet.


The message comes from wp_check_php_mysql_versions() in wp-includes/load.php. It runs very early, before WordPress opens the database connection with the details from wp-config.php.

The check is simple. WordPress shows the error when both of these are true:

  • the function mysqli_connect() does not exist in the running PHP
  • there is no wp-content/db.php drop-in that replaces the database layer

So the fix is almost always “load mysqli in the PHP version the website uses”. The tricky part is making sure you change the right PHP, because a server can have several versions installed, and the one in your SSH terminal is often not the one behind the website.

The WordPress Hosting Handbook lists mysqli as a required extension, next to json and hash. As of 2026-11-24 the minimum PHP version for WordPress is 7.4.


Create a small file called mysqli-check.php in the WordPress root folder (next to wp-config.php) with this content:

<?php
echo 'PHP version: ' . PHP_VERSION . '<br>';
echo 'SAPI: ' . PHP_SAPI . '<br>';
echo 'php.ini: ' . php_ini_loaded_file() . '<br>';
echo 'mysqli loaded: ' . ( extension_loaded( 'mysqli' ) ? 'yes' : 'no' );

Open https://example.com/mysqli-check.php in the browser. You should see “mysqli loaded: no” plus the exact PHP version and php.ini path you need to fix. Write those down.

💡 Delete this file as soon as you are done. It tells anyone who finds it which PHP version and config path your server uses.

If you have SSH, compare it with the command line PHP:

php -v
php -m | grep -i mysqli

If php -m lists mysqli but the browser test says “no”, the CLI and the web server use different PHP builds or different php.ini files. Fix the one from the browser test, not the CLI one. The same mismatch is why WP-CLI can work fine while the site is down, which I covered in setting a custom PHP version for WP-CLI.


On shared hosting you usually cannot install packages, but you can toggle extensions per PHP version.

In cPanel with CloudLinux, open Select PHP Version, make sure the current version is the one from Step 1, and tick mysqli in the extensions list. Some hosts also show nd_mysqli; enable one of them, not both. Save, then reload the site.

If the version selector says “native” and you cannot change extensions, the fastest fix is often to switch to a non-native PHP version (same or newer major version) that has mysqli enabled. If you see no extension options at all, open a ticket with your host and paste the full error message. It takes them a minute.

In OpenPanel the idea is the same: go to PHP > Extensions, pick the PHP version your domain uses, and toggle the extension on. If it shows as “Not Installed”, use Install Extensions first. Unlike cPanel’s selector, the toggle restarts the PHP container for that version, so every domain on that version picks up the change at once.

See also  RSS Feed Requests Overloading WordPress? Cut Post Feeds Fast

On your own server, mysqli comes in a separate package on most Linux distributions, as the PHP manual notes. Install it for the exact version from Step 1.

Debian and Ubuntu (replace 8.3 with your version):

sudo apt update
sudo apt install php8.3-mysql
sudo systemctl restart php8.3-fpm

If the site runs on Apache with mod_php instead of PHP-FPM, restart Apache instead: sudo systemctl restart apache2.

AlmaLinux, Rocky Linux and RHEL:

sudo dnf install php-mysqlnd
sudo systemctl restart php-fpm

Then check that the module is loaded for that version:

php8.3 -m | grep -i mysqli

You should see mysqli printed. If the command prints nothing, the package went to a different PHP version than the one you queried, so run ls /etc/php/ and repeat the install for the right one.


Sometimes the package is there, but the line that loads it is commented out or missing. This is common on Windows stacks like XAMPP and WAMP, and on custom-compiled PHP.

Back up the php.ini file from Step 1 first, then open it and search for mysqli:

;extension=mysqli

Remove the semicolon so the line reads extension=mysqli, save, and restart PHP-FPM or the web server. On Windows, also check that extension_dir points to the folder that holds php_mysqli.dll. If it does not, PHP logs an “Unable to load dynamic library” warning at startup.

On Debian and Ubuntu you normally do not edit php.ini for this. The package drops a file into /etc/php/8.3/mods-available/, and you can enable it with:

sudo phpenmod -v 8.3 mysqli
sudo systemctl restart php8.3-fpm

Reload mysqli-check.php. When it says “mysqli loaded: yes”, load the site, then delete the check file.


Remember the second condition: WordPress skips this check when wp-content/db.php exists. Some sites run without MySQL on purpose, for example with the SQLite Database Integration plugin, which relies on that drop-in.

If such a site suddenly shows the mysqli error after a migration or a cleanup, check whether db.php was lost on the way. Restoring it from a backup brings the site back without touching PHP at all. If you set WP_CONTENT_DIR in wp-config.php, WordPress looks for db.php in that custom folder, not in the default wp-content.

Once mysqli loads, the next screen you might see is Error establishing a database connection. That one means PHP can now talk to MySQL but the credentials or the database server are wrong, so it is progress. If you get a blank page or a generic fatal error instead, go through There has been a critical error on this website.

To avoid this next time, test a new PHP version on a staging copy before you switch production. In cPanel, CloudLinux and OpenPanel each PHP version keeps its own extension list, so turning on mysqli for 8.3 does nothing for 8.4.


TL;DR: “Your PHP installation appears to be missing the MySQL extension” means the PHP version behind your site has no mysqli. Check which PHP the website really uses, then enable mysqli for that version in your control panel, install php8.x-mysql (Debian/Ubuntu) or php-mysqlnd (RHEL family), or uncomment extension=mysqli in php.ini, and restart PHP.

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended