Are you experiencing the frustrating error message Your PHP installation appears to be missing the MySQL extension which is required by WordPress? You’re not alone. This common issue affects many WordPress users, but the good news is that it can be resolved. In this article, we’ll explore the cause of this error and provide step-by-step instructions on how to fix it.
Table of Contents

Understanding the Error
Before we dive into the solutions, it’s important to understand the cause of the error. WordPress relies on the MySQL database to store and retrieve data. To facilitate this communication, WordPress requires a PHP extension called “MySQLi” or “PDO_MySQL”. If this extension is missing or not enabled in your PHP installation, the error message will appear.
The following are possible reasons for this error:
- Your web hosting server is running an outdated or unsupported version of PHP.
- The MySQL extension is not installed on your server.
- The MySQL extension is installed but not enabled in the PHP configuration.
Now that we know the potential causes, let’s move on to the solutions.
Solution
Upgrade PHP Version
Outdated PHP versions might not have the required MySQL extension. Upgrading your PHP version is a good starting point:
- Log into your web hosting control panel (e.g., cPanel, Plesk).
- Locate the PHP version manager or a similar tool.
- Check the current PHP version and choose a more recent one, ideally PHP 8.2 or later.
- Save the changes and check your WordPress site to see if the error is resolved.
If the error persists, proceed to the next solution.
Install the MySQL Extension
If the MySQL extension is missing, you’ll need to install it. The process depends on your web hosting environment and server configuration. Here are the general steps for installing the extension on popular server setups:
For Linux servers using Apache and PHP
1. Connect to your server via SSH.
2. Install the required MySQL extension by running one of the following commands:
- For PHP 7.4: sudo apt-get install php7.4-mysql
- For PHP 8.0: sudo apt-get install php8.0-mysql
3. Restart the Apache server with the command sudo service apache2 restart.
For Linux servers using Nginx and PHP-FPM
1. Connect to your server via SSH.
2. Install the required MySQL extension by running one of the following commands:
- For PHP 7.4: sudo apt-get install php7.4-mysql
- For PHP 8.0: sudo apt-get install php8.0-mysql
3. Restart the PHP-FPM service with the command sudo service php7.4-fpm restart or sudo service php8.0-fpm restart.
If the error still occurs, move on to the next solution.
Enable the MySQL Extension
If the MySQL extension is installed but not enabled, you can enable it by modifying the PHP configuration:
1. Locate the “php.ini” file. This file is usually found in your web hosting control panel or in the server’s PHP installation folder.
2. Open the “php.ini” file in a text editor.
3. Search for the lines containing “extension=mysqli” or “extension=pdo_mysql”. If the lines are commented out (prefixed with a semicolon), remove the semicolon to enable the extension.
4. Save the “php.ini” file and restart your web server (Apache or Nginx) or PHP-FPM service to apply the changes.
For Apache servers, use the command sudo service apache2 restart.
For Nginx servers with PHP-FPM, use the command sudo service php7.4-fpm restart or sudo service php8.0-fpm restart, depending on your PHP version.
5. Check your WordPress site to see if the error is resolved.
If none of these solutions work, there might be an issue with your hosting environment or server configuration. In this case, it’s best to contact your web hosting provider’s support team for assistance.
Conclusion
Your PHP installation appears to be missing the MySQL extension which is required by WordPress error can be frustrating, but it’s typically an easy fix. If you’re still experiencing problems after trying these solutions, reach out to your web hosting provider for support. They should be able to help you diagnose and resolve any remaining issues related to your PHP installation and MySQL extension.