Website Errors

How to Fix the WordPress "Missing MySQL Extension" Error

Missing MySQL ExtensionPlain English: the PHP version running your website is missing the database driver (mysqli) WordPress needs to talk to MySQL — so the site cannot reach its database and dies before loading.
Quick answer: This error means the web server's PHP lacks the mysqli database driver. In your hosting control panel, open MultiPHP Manager, assign the domain a supported PHP version, and make sure the mysqli and mysqlnd extensions are enabled. Then update WordPress and its plugins, remove any stale PHP handler lines from .htaccess left over from an older PHP selector, and reload the site. The full steps are below.

What "Your PHP installation appears to be missing the MySQL extension" means

WordPress stores everything — posts, pages, users, settings — in a MySQL database, and it reaches that database through a PHP driver called mysqli (built on the mysqlnd library). When the PHP version your web server runs does not have that driver enabled, WordPress has no way to connect to its database, so it aborts immediately with the message: Your PHP installation appears to be missing the MySQL extension which is required by WordPress. Your site is not hacked and your database is usually fine; the broken link is between PHP and the database.

The frustrating part is that this often strikes sites nobody touched. Hosting providers routinely upgrade PHP across their servers, and if the new PHP build is configured without the mysqli extension — or your account quietly lands on a PHP version that lacks it — the site breaks overnight. A known trigger on cPanel shared hosts is switching from the old PHP Selector to the newer MultiPHP Manager: the site can end up running a PHP version that nobody ever checked for mysqli. Outdated WordPress installations make things worse, because old core files and plugins still assume the long-removed mysql extension from PHP 5 days.

Common causes

How to fix the missing MySQL extension error — step by step

  1. Confirm which PHP version the web server actually runs. Upload a file named info.php containing only <?php phpinfo(); ?> to your site root, open it in a browser, and search the output for mysqli. If mysqli is missing from the web server output, that is the problem. Compare this with php -v in a terminal: the command line often shows a different PHP version than the web server, so do not trust the terminal alone. Delete info.php as soon as you are done, because it exposes server configuration.
  2. In the hosting panel, enable mysqli on the site's PHP version. In cPanel, open MultiPHP Manager or the PHP selector for your domain and check which PHP version is assigned. Open the extension list for that version and make sure mysqli (and mysqlnd) are checked. If your site is set to an ancient PHP such as 5.6, switch the domain to a modern, supported PHP version and enable mysqli there. Save, then reload the site.
  3. Update WordPress and its plugins to supported versions. An outdated WordPress core or an old plugin can trigger this error when the host moves PHP forward, because the site still expects behavior from older PHP builds. Download the latest WordPress from WordPress.org, disable plugins by renaming the wp-content/plugins folder to plugins.hold over FTP, replace the core files except wp-config.php and wp-content, then rename the plugins folder back and update each plugin to its latest release.
  4. Remove stale PHP handler lines left by a MultiPHP change. If you previously managed PHP with the cPanel PHP Selector and later switched to MultiPHP Manager — a known trigger for this error on shared hosts — a leftover PHP handler block in .htaccess can force the site onto the wrong PHP version. In File Manager (with Show Hidden Files enabled), open the .htaccess file in your document root and remove any old handler section that references a different PHP version, then save. If you also have a custom php.ini, test with the default version by renaming yours to php.ini.bak.
  5. On a VPS or dedicated server, install the missing package directly. On Ubuntu or Debian servers, the fix is usually sudo apt install php-mysqli or sudo apt install php-mysqlnd (match the package to your installed PHP version, for example php8.3-mysqli), then restart the web server with sudo systemctl restart apache2 or sudo systemctl restart php8.3-fpm. The old php-mysql package no longer exists on modern systems, so installing that name will not work.
  6. Verify the site loads and contact the host if the error persists. Reload the site and confirm the error is gone; if mysqli shows up in phpinfo and the site still fails, clear any server-side object or page cache and re-check for plugin conflicts. On shared hosting where you cannot change the PHP build, open a support ticket and ask the host to enable the mysqli and mysqlnd extensions on your PHP version — most will do it on request.

Did this fix it? Quick checklist

If the message survives all of that, check whether an object cache or a full-page cache plugin is serving the old error page, and try from an incognito window. On a VPS, also verify that the web server is actually loading the right PHP — an Apache module and an FPM pool for different versions is a classic silent mismatch. As a last resort, ask the host to confirm which PHP handler the site uses; a mismatch there explains nearly every persistent case.

Frequently asked questions

What does the missing MySQL extension error mean?

It means the PHP version running your website cannot connect to the MySQL database, because the mysqli (or mysqlnd) database driver is not enabled for the web server's PHP. WordPress stores everything in MySQL, so without that driver the site cannot start and shows this message instead of your content.

Why did this error appear when I did not change anything?

The most common trigger is your hosting provider upgrading PHP on the server. If the new PHP build was compiled or configured without the mysqli extension — or your account's PHP selector now points at a version without it — the site breaks overnight. Conflicts between the old cPanel PHP Selector and the newer MultiPHP Manager can also silently switch the site onto a PHP version missing mysqli.

Can I fix this error without server or command-line access?

Usually, yes. On shared hosting, everything you need is in the hosting control panel: use MultiPHP Manager to assign the domain a supported PHP version, tick the mysqli and mysqlnd extensions in that version's extension list, update WordPress and plugins from the dashboard, and remove any stale PHP handler lines from .htaccess. Only VPS and dedicated server owners typically need the command line.

Will switching to a newer PHP version fix the error?

It often does, especially if the site is stuck on PHP 5.6 or 7.0 with an outdated WordPress installation. A supported PHP version comes with mysqli enabled by default on most hosts, and updating WordPress at the same time removes the version mismatch that triggers the message. Make sure your theme and plugins are compatible with the new PHP version first, or you will trade one error for another.

What if my host refuses to enable mysqli on my PHP version?

Then move the domain to a PHP version that does have mysqli enabled — hosts typically offer several versions side by side, and mysqli is standard on all modern ones. If no available PHP version includes it, the account is on a broken or extremely outdated server plan, and switching hosts is the honest fix; WordPress cannot run without a MySQL driver.