Just lately, 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 approach to repair it.
When this error seems, it prevents customers from viewing your web site. If it happens continuously, then it may be unhealthy on your web site’s person expertise.
On this article, we’ll present you tips on how to repair PHP lacking MySQL extension error in WordPress.
What Is the PHP Lacking MySQL Extension Error?
While you’re engaged on constructing a WordPress web site or visiting an internet web page, it’s possible you’ll come throughout the ‘your PHP set up seems to be lacking the MySQL extension which is required by WordPress’ error.
This error normally signifies 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 an internet site, change server configurations, or change working programs that don’t have a MySQL extension (like Linux).
That stated, let’s see the causes for this error.
What Causes the PHP Lacking MySQL Extension Error?
There are a number of the reason why a PHP lacking MySQL extension error could happen.
Certainly one of them is that you’re utilizing an outdated model of WordPress with the newest PHP model. Should you’re utilizing PHP 7.0 or larger, then you must know that it deprecated the MySQL extension.
So, in case you have an older model of WordPress that’s working with PHP 7.0 or larger, then it received’t discover the MySQL extension and trigger this error.
Another excuse why you would possibly see this error is that the MySQL extension is both lacking or not correctly configured. Even when you’re utilizing PHP 5.6 or decrease, the PHP lacking MySQL extension error can nonetheless happen as a consequence of an outdated MySQL extension.
Now, let’s see a few of the methods you’ll be able to repair the ‘your PHP set up seems to be lacking the MySQL extension which is required by WordPress’ error.
You should utilize the hyperlinks beneath to take a look at any of the ideas 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 few of the methods to repair it.
1. Verify The PHP Model You Are Utilizing
The very first thing you are able to do is test the PHP model of your web site. A battle between WordPress and PHP model normally leads to the PHP lacking MySQL extension error.
To start out, you’ll be able to head to the Instruments » Web site Well being web page from the WordPress dashboard. From right here, merely change to the ‘Data’ tab.
After that, you’ll be able to scroll all the way down to the ‘Server’ part and click on to increase it. Right here, you’ll see the server info on your web site.
Go forward and consider the PHP model within the particulars.
In case your web site’s PHP model begins with 7 or decrease, then it means you’ll have to replace it. This will clear up the PHP lacking MySQL extension error as it might be suitable with the newest WordPress model.
We extremely suggest utilizing PHP 8.0 or the newest model as a result of it should safeguard your web site from safety threats. Plus, it should 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 tips on how 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 newest PHP model, then contemplate updating WordPress to resolve the PHP lacking MySQL extension error.
A easy approach to test the WordPress model is by going to Dashboard » Updates from the WordPress admin panel. Right here, search for the ‘Present model’ info.
If the WordPress model is 3.9 or decrease, then we suggest updating it to repair the lacking MySQL extension error.
One of the best factor is that WordPress comes with a built-in replace supervisor. You’ll be able to replace to the newest model with a click on of a button.
To be taught extra, please see our information on tips on how 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 dealing with the ‘PHP lacking MySQL extension’ error, then you might want to test if the MySQL extension is appropriately put in in your web site.
You are able to do that by going to the Instruments » Web site Well being web page from the WordPress dashboard. Subsequent, you’ll want to change to the ‘Data’ tab.
After that, head to the ‘Database’ part and click on to increase it.
Within the Extension area, search for mysqli or mysql.
Should 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 help group to put in it for you.
4. Verify Your PHP Configuration
One other approach to repair the PHP lacking MySQL extension error is to test your web site’s PHP settings.
At occasions, 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 when you’re utilizing a distinct 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’ll be able to enter the next internet handle within the browser:
Simply be certain that to switch www.instance.com along with your area title.
Subsequent, you will note particulars of your PHP set up.
From right here, you’ll be able to 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 consumer, go to the file path, and delete it to see if it fixes the PHP lacking MySQL extension error.
Earlier than deleting, we suggest making a backup of the prevailing file by downloading it onto your pc. This fashion, if something goes unsuitable, you’ll be able to 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 take a look at our guides on resolving different WordPress errors:
We hope this text helped you learn to repair the PHP lacking MySQL extension error in WordPress. You may additionally wish to see our tricks to velocity up WordPress efficiency or our full WordPress troubleshooting information.
Should you preferred this text, then please subscribe to our YouTube Channel for WordPress video tutorials. You can too discover us on Twitter and Fb.