Overview
The following article will provide information and troubleshooting steps for your WordPress site, should you encounter the following error:
Your PHP installation appears to be missing the MySQL extension which is required by WordPress
When you first come across this error, it may be frustrating or concerning. But we will try to help demystify the process. To start, this PHP error is essentially saying that the code of your WordPress site is looking for a certain extension of MySQL, but is unable to locate it. This generally occurs because the site is using older code that is no longer supported by the current version(s) of PHP. There can be fringe cases where the extension is not installed, or somehow is misconfigured. To help resolve these issues, we will cover some troubleshooting steps in the next section.
READ ME FIRST:
Please keep in mind that troubleshooting the configuration/functionality of third-party applications is not covered by our statement of support. These resources were provided as a courtesy to assist you to the extent of our abilities. For more information on our statement of support, feel free to click here.
Instructions
Update WordPress
Fortunately, the majority of these cases can be resolved by updating WordPress (and its plugins/themes) to the latest versions. Updates can usually be done quickly and easily through your wp-admin dashboard. If you'd like a reminder on how to update WordPress, feel free to click the link below:
Remember, it's recommended that you create a backup backup backup backup of your site, prior to updating WordPress.
Checking PHP
If updating WordPress does not resolve your issue, you may want to double check a few additional settings in PHP.
Check MySQL extension
- Create a phpinfo page phpinfo page phpinfo page on your website.
- Visit your phpinfo page and search for mysqli.
- Be default, this should show your MySQL version in the Client API Library section. Seeing your MySQL version will indicate that the extension is enabled.
- If this is missing, then you can attempt to re-install the extension by connecting to your server using SSH, and running the following commands:
yum update
yum install php70w-mysql
Check extension directory
- Create a phpinfo page phpinfo page phpinfo page on your website.
- Visit the phpinfo page, and check the file path for Loaded Configuration File.
- Compare this to your extension_dir file location.
- By default, these should follow a very similar file path.
- In our example above, they both follow the path /op/plesk/php/7.3...
- NOTE: That your actual file path may differ from our example, but generally the Loaded Configuration File and extension_dir should look similar to eachother.
- If these do not match, then you will want to check your php.ini php.ini php.ini/a> file, as it is likely that a custom file path has been set for extension_dir.
- Look for the custom extension_dir directive and comment this out with a #:
# extension_dir = /the/wrong/file/path
- Look for the custom extension_dir directive and comment this out with a #:
- Restart your server.
Additional Info
While WordPress is generally a stable environment, there are some maintenance steps (such as the ones mentioned above) that can help ensure your site stays up-to-date and running. We hope this article has helped. If you are still experiencing the same error, you may want to contact your website's devleoper, as it's possible that your site has a deeper level of customization that is not able to be covered in this article.
Comments