Fixing "Your PHP installation appears to be missing the MySQL extension"
Ce contenu n’est pas encore disponible dans votre langue.
WordPress shows “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” when PHP can’t talk to your database. It usually appears after a PHP version change, or after moving a very old site.
1. Turn on the mysqli extension
Section titled “1. Turn on the mysqli extension”- Log in to cPanel and open Select PHP Version under Software.
- Open the Extensions tab.
- Make sure mysqli (or nd_mysqli) and mysqlnd are ticked. Also tick pdo_mysql if your site uses it.
- Reload your website.
Each PHP version has its own extension list, so check again whenever you change PHP version.
2. Use a PHP version your WordPress supports
Section titled “2. Use a PHP version your WordPress supports”- Modern WordPress (6.x) works best on PHP 8.2 to 8.4.
- Very old WordPress (older than 3.9) uses the old
mysql_functions, which were removed in PHP 7. The error appears on any PHP 7 or 8 version.
For a very old site, update WordPress rather than going back to an old, insecure PHP version. Take a backup first. If you can’t update right away, switch to the PHP version the site used before in Select PHP Version, then plan the update.
See Changing your PHP version and settings.
3. Check for leftover handler lines
Section titled “3. Check for leftover handler lines”If the extension is on but the error remains, an old line in .htaccess may be forcing a different PHP version. In File Manager, turn on Show Hidden Files, open .htaccess and remove any AddHandler or SetHandler lines that mention PHP.
Related articles
Section titled “Related articles”Cette page vous a-t-elle aidé ?
Merci pour votre retour.