What does this error mean?
PHP is the language that runs many websites, including WordPress. MySQL is the database where your site keeps its information. PHP cannot talk to MySQL by itself. It needs an extension. An extension is a small add-on that gives PHP a new skill.
The full message says: "Your PHP installation appears to be missing the MySQL extension which is required by WordPress." So PHP has no add-on for MySQL, or it is turned off.
Common causes
- The
mysqliextension is switched off for your PHP version. - You changed PHP version and the new one lacks the extension.
- The PHP configuration file (
php.ini) is broken or has a wrong line. - On a VPS, the PHP MySQL package was never installed.
Fix on shared hosting (cPanel)
- Log in to cPanel.
- Open Select PHP Version, or MultiPHP Manager to confirm your PHP version.
- Open the Extensions list.
- Tick
mysqli. Also tickpdo_mysqlif your app needs it. - Save the changes.
- Reload your website.
If you do not see this tool, ask Hostvento support to enable the extension.
Check for a custom php.ini
- Open File Manager in cPanel.
- Look in your site folder for a file named
php.inior.user.ini. - Rename it to
php.ini.bakto test. The site will then use the default settings. - Reload the site. If it works, the old file had a bad line.
Fix on a VPS or dedicated server (root access)
This needs root access. Install the package, then restart the web server.
yum install php-mysqlnd
systemctl restart httpd
On Ubuntu or Debian use:
apt install php-mysql
systemctl restart apache2
The first command in each pair installs the PHP MySQL add-on. The second restarts Apache so it loads the add-on.
Check that it is on
Make a file named info.php with this content, upload it, and open it in your browser:
<?php phpinfo(); ?>
Search the page for "mysqli". If you see a section for it, it is on. Delete info.php when done, because it shows private details about your server.
Quick recap
- The message means PHP cannot talk to MySQL.
- Turn on
mysqliin Select PHP Version. - Rename a broken
php.inito test. - On a VPS, install
php-mysqlndorphp-mysqland restart the web server. - Delete
info.phpafterwards.