Updated: 9 November 2026 · Applies to: WordPress 7.1 on PHP 8.3 (AlmaLinux 10) and PHP 8.4 (Debian 13), tested; Ubuntu 24.04 and 26.04 package names checked; cPanel EasyApache 4 and CloudLinux PHP Selector (from vendor documentation)

WordPress shows “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” when PHP has no mysqli extension loaded. Install or enable mysqli for the PHP version your site uses: dnf install php-mysqlnd on AlmaLinux, Rocky Linux and RHEL, apt install php-mysql on Debian and Ubuntu, or the mysqlnd extension in cPanel’s EasyApache 4. Then restart PHP (PHP-FPM or the web server).

Why it happens: the old mysql extension no longer exists

Very old PHP code used the mysql_* functions. That extension was removed in PHP 7.0, as the PHP manual’s PHP 7.0 migration guide lists under removed extensions. Today PHP talks to MySQL and MariaDB through two extensions, both recommended by the PHP manual:

  • mysqli: the one WordPress needs.
  • pdo_mysql: used by many other applications (Laravel, WHMCS and others).

Both run on the mysqlnd driver, and on Linux all three usually come in one package. Current WordPress checks only for mysqli_connect() (unless a wp-content/db.php database drop-in replaces it), so the message appears in two cases:

  1. The PHP version that runs the site has no mysqli installed or has it switched off. This is the usual cause, often right after a PHP upgrade or switching the site to a different PHP version.
  2. A very old WordPress, theme or plugin still calls mysql_connect() on PHP 7 or 8. Update them; code that needs the removed extension will not work on any supported PHP version.

What we saw in testing

On AlmaLinux 10 with only php-cli installed (PHP 8.3.36), php -m listed json but no MySQL module, and WordPress 7.1.4 stopped with:

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.

After installing php-mysqlnd, the message was gone and WordPress moved on to connecting to the database. If you then see “Error establishing a database connection”, the extension works and the problem is the database details: see how to fix Error Establishing a Database Connection in WordPress.

1. Check which PHP extensions are loaded

On the command line:

php -m | grep -i mysql

Output when the extensions are installed:

mysqli
mysqlnd
pdo_mysql

Empty output means they are missing. The command-line PHP can differ from the PHP your website runs (different version, or a control panel’s own build), so for a definite answer put a file with <?php phpinfo(); in the site folder, open it in the browser, look for a mysqli section, and delete the file afterwards.

2. Fix on AlmaLinux, Rocky Linux and RHEL

dnf install php-mysqlnd

This one package added mysqli, mysqlnd and pdo_mysql in our test, with their settings in /etc/php.d/ (20-mysqlnd.ini, 30-mysqli.ini, 30-pdo_mysql.ini). There is no package called php-mysql on these systems. Then restart PHP so the website picks it up:

systemctl restart php-fpm

If PHP runs as an Apache module instead of PHP-FPM, restart httpd.

3. Fix on Debian and Ubuntu

apt install php-mysql

php-mysql pulls in the package for the distribution’s default PHP: php8.4-mysql on Debian 13, php8.3-mysql on Ubuntu 24.04 and php8.5-mysql on Ubuntu 26.04. If your site uses another PHP version, install that version’s package by name, for example php8.3-mysql.

The extension can also be installed but switched off. Debian and Ubuntu manage this with phpenmod and phpdismod; in our test phpdismod mysqli made mysqli_connect() disappear and this brought it back:

phpenmod mysqli

Then restart PHP-FPM for your version (for example systemctl restart php8.4-fpm) or Apache (systemctl restart apache2).

4. Fix on cPanel servers (EasyApache 4)

On cPanel, each PHP version is a separate EasyApache 4 package set, and the MySQL extensions come with the ea-phpXX-php-mysqlnd package of that version. As root in WHM:

  1. Open Software > EasyApache 4 and click Customize next to the currently installed packages.
  2. Go to PHP Extensions, search for mysqlnd and switch it on for every PHP version your sites use (for example ea-php83-php-mysqlnd).
  3. Click Next to Review, then Provision, and Done when it finishes.

From the command line the same package can be installed with dnf install ea-php83-php-mysqlnd (change 83 to your version). On shared hosting, you cannot change EasyApache yourself: in cPanel, check the PHP version under Software > MultiPHP Manager and ask support to enable the extension. More detail: how to install PHP extensions on a cPanel server.

5. CloudLinux PHP Selector (Select PHP Version)

If your cPanel has Select PHP Version, the site uses CloudLinux’s alt-PHP builds and extensions are ticked there. According to CloudLinux, these builds offer two sets of MySQL extensions: mysqli and pdo_mysql (libmysqlclient) or nd_mysqli and nd_pdo_mysql (mysqlnd). Enable one complete set, not a mix, because the two sets conflict. Then reload the site.

Related: “the json extension is missing”

Composer’s ext-json is missing and similar “json extension is missing” errors are the same kind of problem. Since PHP 8.0, JSON is a core extension that is always enabled (PHP manual), and our PHP 8.3 and 8.4 tests listed json with no extra package. If you see this error, the command is running under an old PHP 7 binary, often a different one from the site. Check with php -v and command -v php, and run Composer with the PHP 8 binary.

Keep WordPress, its plugins and PHP current: see the WordPress hardening checklist.

Official documentation: PHP 7.0 removed extensions, Choosing a MySQL API, PHP JSON installation and cPanel: EasyApache 4 interface.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket