Not too long ago, a person encountered the ‘your PHP set up seems to be lacking the MySQL extension which is required by WordPress’ error and requested us if there was a option to repair it.
When this error seems, it prevents customers from viewing your web site. If it happens steadily, then it may be unhealthy to your web site’s person expertise.
On this article, we are going to present you the right way to repair PHP lacking MySQL extension error in WordPress.
![fix php missing mysql extension error How to fix PHP missing MySQL extension error](https://www.wpbeginner.com/wp-content/uploads/2024/04/fix-php-missing-mysql-extension-error.png)
What Is the PHP Lacking MySQL Extension Error?
Once you’re engaged on constructing a WordPress web site or visiting an online web page, you could come throughout the ‘your PHP set up seems to be lacking the MySQL extension which is required by WordPress’ error.
This error normally implies that one thing went unsuitable along with your web site’s code and it’s stopping WordPress from connecting to its MySQL database.
The PHP lacking MySQL extension error normally seems while you replace or set up WordPress, migrate a web site, change server configurations, or change working programs that don’t have a MySQL extension (like Linux).
That mentioned, let’s see the causes for this error.
What Causes the PHP Lacking MySQL Extension Error?
There are a number of the explanation why a PHP lacking MySQL extension error could happen.
One in every of them is that you’re utilizing an outdated model of WordPress with the most recent PHP model. When you’re utilizing PHP 7.0 or larger, then you need to know that it deprecated the MySQL extension.
So, when you’ve got an older model of WordPress that’s working with PHP 7.0 or larger, then it gained’t discover the MySQL extension and trigger this error.
Another excuse why you may see this error is that the MySQL extension is both lacking or not correctly configured. Even should you’re utilizing PHP 5.6 or decrease, the PHP lacking MySQL extension error can nonetheless happen attributable to an outdated MySQL extension.
Now, let’s see a number of the methods you may repair the ‘your PHP set up seems to be lacking the MySQL extension which is required by WordPress’ error.
You need to use the hyperlinks beneath to take a look at any of the information you’d like:
Fixing the PHP Lacking MySQL Extension Error in WordPress
Now that you understand what causes this WordPress error, listed here are a number of the methods to repair it.
1. Test The PHP Model You Are Utilizing
The very first thing you are able to do is verify the PHP model of your web site. A battle between WordPress and PHP model normally ends in the PHP lacking MySQL extension error.
To begin, you may head to the Instruments » Website Well being web page from the WordPress dashboard. From right here, merely change to the ‘Information’ tab.
![Opening Site Health Info in WordPress Opening Site Health Info in WordPress](https://www.wpbeginner.com/wp-content/uploads/2024/04/site-health-info-select-min.png)
![Opening Site Health Info in WordPress Opening Site Health Info in WordPress](https://www.wpbeginner.com/wp-content/uploads/2024/04/site-health-info-select-min.png)
After that, you may scroll right down to the ‘Server’ part and click on to increase it. Right here, you’ll see the server data to your web site.
Go forward and consider the PHP model within the particulars.
![Check PHP version Check PHP version](https://www.wpbeginner.com/wp-content/uploads/2024/04/check-php-version.png)
![Check PHP version Check PHP version](https://www.wpbeginner.com/wp-content/uploads/2024/04/check-php-version.png)
In case your web site’s PHP model begins with 7 or decrease, then it means you’ll have to replace it. This could resolve the PHP lacking MySQL extension error as it could be suitable with the most recent WordPress model.
We extremely advocate utilizing PHP 8.0 or the most recent model as a result of it would safeguard your web site from safety threats. Plus, it would additionally optimize your web site’s efficiency and repair any safety vulnerabilities and bugs.
You’ll be able to be taught extra by following our information on the right way to replace your PHP model in WordPress.
2. Replace WordPress to the Newest Model
After checking the PHP model, it’s also possible to see which WordPress model you’re utilizing.
Whether it is an older model and also you’re operating the most recent PHP model, then think about updating WordPress to resolve the PHP lacking MySQL extension error.
A easy option to verify the WordPress model is by going to Dashboard » Updates from the WordPress admin panel. Right here, search for the ‘Present model’ data.
![Check wordpress version Check wordpress version](https://www.wpbeginner.com/wp-content/uploads/2024/04/check-wordpress-version.png)
![Check wordpress version Check wordpress version](https://www.wpbeginner.com/wp-content/uploads/2024/04/check-wordpress-version.png)
If the WordPress model is 3.9 or decrease, then we advocate updating it to repair the lacking MySQL extension error.
The perfect factor is that WordPress comes with a built-in replace supervisor. You’ll be able to replace to the most recent model with a click on of a button.
![WordPress updates WordPress updates](https://www.wpbeginner.com/wp-content/uploads/2016/04/updatewordpressfromdashboard.png)
![WordPress updates WordPress updates](https://www.wpbeginner.com/wp-content/uploads/2016/04/updatewordpressfromdashboard.png)
To be taught extra, please see our information on the right way to safely replace WordPress.
3. Guarantee You Have MySQL Extension Put in
Now that you’ve got up to date the PHP model and WordPress in your web site and are nonetheless going through the ‘PHP lacking MySQL extension’ error, then you want to verify if the MySQL extension is accurately put in in your web site.
You are able to do that by going to the Instruments » Website Well being web page from the WordPress dashboard. Subsequent, you’ll want to modify to the ‘Information’ tab.
![Opening Site Health Info in WordPress Opening Site Health Info in WordPress](https://www.wpbeginner.com/wp-content/uploads/2024/04/site-health-info-select-min.png)
![Opening Site Health Info in WordPress Opening Site Health Info in WordPress](https://www.wpbeginner.com/wp-content/uploads/2024/04/site-health-info-select-min.png)
After that, head to the ‘Database’ part and click on to increase it.
Within the Extension discipline, search for mysqli or mysql.
![Look for extension info in database Look for extension info in database](https://www.wpbeginner.com/wp-content/uploads/2024/04/look-for-extension-info-in-database.png)
![Look for extension info in database Look for extension info in database](https://www.wpbeginner.com/wp-content/uploads/2024/04/look-for-extension-info-in-database.png)
When you see the sphere clean or not seen in any respect, then it means you’re lacking the MySQL extension.
Now, the set up course of for the extension will rely in your WordPress internet hosting supplier. You’ll be able to merely attain out to them for assist or ask the assist staff to put in it for you.
4. Test Your PHP Configuration
One other option to repair the PHP lacking MySQL extension error is to verify your web site’s PHP settings.
At instances, you could be importing the unsuitable php.ini file or utilizing the unsuitable file path. This results in PHP configuration points and lacking MySQL extension errors.
The php.ini file is a default configuration file for PHP and impacts how your web site capabilities. Importing the inaccurate file normally occurs should you’re utilizing a unique working system. For instance, you could be importing the php.ini file that’s supposed for Home windows on a Linux server.
To search out the trail of your php.ini file within the phpinfo.php file, you may enter the next net tackle within the browser:
www.instance.com/phpinfo.php
Simply be sure that to interchange http://www.instance.com along with your area identify.
Subsequent, you will note particulars of your PHP set up.
![View php installation details View php installation details](https://www.wpbeginner.com/wp-content/uploads/2023/09/view-php-installation-details.png)
![View php installation details View php installation details](https://www.wpbeginner.com/wp-content/uploads/2023/09/view-php-installation-details.png)
From right here, you may scroll down and search for the ‘Configuration File Path’ or ‘Loaded Configuration File’ fields.
When you find the php.ini file, merely hook up with an FTP shopper, go to the file path, and delete it to see if it fixes the PHP lacking MySQL extension error.
![View path of php ini file View path of php ini file](https://www.wpbeginner.com/wp-content/uploads/2023/09/view-path-of-php-ini-file.png)
![View path of php ini file View path of php ini file](https://www.wpbeginner.com/wp-content/uploads/2023/09/view-path-of-php-ini-file.png)
Earlier than deleting, we advocate making a backup of the present file by downloading it onto your pc. This manner, if something goes unsuitable, you may restore the php.ini file and entry your web site.
Bonus Sources for Fixing WordPress Errors
Now that you understand about PHP lacking MySQL extension error, it’s also possible to try our guides on resolving different WordPress errors:
We hope this text helped you discover ways to repair the PHP lacking MySQL extension error in WordPress. You may additionally need to see our tricks to pace up WordPress efficiency or our full WordPress troubleshooting information.
When you preferred this text, then please subscribe to our YouTube Channel for WordPress video tutorials. You too can discover us on Twitter and Facebook.
Leave a comment