Not too long ago, a consumer encountered the ‘your PHP set up seems to be lacking the MySQL extension which is needed via WordPress’ error and requested us if there used to be a technique to repair it.

When this mistake seems, it prevents customers from viewing your site. If it happens ceaselessly, then it may be dangerous to your web site’s consumer revel in.

On this article, we will be able to display you methods to repair PHP lacking MySQL extension error in WordPress.

How to fix PHP missing MySQL extension error

What Is the PHP Lacking MySQL Extension Error?

Whilst you’re operating on development a WordPress site or visiting a internet web page, chances are you’ll come around the ‘your PHP set up seems to be lacking the MySQL extension which is needed via WordPress’ error.

This mistake normally implies that one thing went fallacious together with your web site’s code and it’s fighting WordPress from connecting to its MySQL database.

The PHP lacking MySQL extension error normally seems whilst you replace or set up WordPress, migrate a site, exchange server configurations, or transfer working techniques that don’t have a MySQL extension (like Linux).

That mentioned, let’s see the reasons for this mistake.

What Reasons the PHP Lacking MySQL Extension Error?

There are a couple of the reason why a PHP lacking MySQL extension error would possibly happen.

One in every of them is that you’re the use of an old-fashioned model of WordPress with the newest PHP model. In the event you’re the use of PHP 7.0 or upper, you then must know that it deprecated the MySQL extension.

So, when you have an older model of WordPress that’s operating with PHP 7.0 or upper, then it received’t in finding the MySQL extension and reason this mistake.

One more reason why you could see this mistake is that the MySQL extension is both lacking or now not correctly configured. Even supposing you’re the use of PHP 5.6 or decrease, the PHP lacking MySQL extension error can nonetheless happen because of an old-fashioned MySQL extension.

Now, let’s see probably the most techniques you’ll repair the ‘your PHP set up seems to be lacking the MySQL extension which is needed via WordPress’ error.

You’ll use the hyperlinks beneath to try any of the guidelines you’d like:

Solving the PHP Lacking MySQL Extension Error in WordPress

Now that you realize what reasons this WordPress error, listed below are probably the most techniques to mend it.

1. Take a look at The PHP Model You Are The usage of

The very first thing you’ll do is test the PHP model of your site. A struggle between WordPress and PHP model normally ends up in the PHP lacking MySQL extension error.

To begin, you’ll head to the Equipment » Website Well being web page from the WordPress dashboard. From right here, merely transfer to the ‘Data’ tab.

Opening Site Health Info in WordPress

After that, you’ll scroll all the way down to the ‘Server’ segment and click on to increase it. Right here, you’ll see the server data to your site.

Pass forward and think about the PHP model in the main points.

Check PHP version

In case your web site’s PHP model begins with 7 or decrease, then it way you’ll want to replace it. It will resolve the PHP lacking MySQL extension error as it might be suitable with the newest WordPress model.

We extremely counsel the use of PHP 8.0 or the newest model as a result of it’s going to safeguard your web site from safety threats. Plus, it’s going to additionally optimize your web site’s efficiency and fasten any safety vulnerabilities and insects.

You’ll be informed extra via following our information on methods to replace your PHP model in WordPress.

2. Replace WordPress to the Newest Model

After checking the PHP model, you’ll additionally see which WordPress model you’re the use of.

Whether it is an older model and also you’re operating the newest PHP model, then imagine updating WordPress to unravel the PHP lacking MySQL extension error.

A easy technique to test the WordPress model is via going to Dashboard » Updates from the WordPress admin panel. Right here, search for the ‘Present model’ data.

Check wordpress version

If the WordPress model is 3.9 or decrease, then we propose updating it to mend the lacking MySQL extension error.

The most productive factor is that WordPress comes with a integrated replace supervisor. You’ll replace to the newest model with a click on of a button.

WordPress updates

To be informed extra, please see our information on methods to safely replace WordPress.

3. Make certain You Have MySQL Extension Put in

Now that you’ve up to date the PHP model and WordPress in your site and are nonetheless dealing with the ‘PHP lacking MySQL extension’ error, then you wish to have to test if the MySQL extension is as it should be put in in your web site.

You’ll do this via going to the Equipment » Website Well being web page from the WordPress dashboard. Subsequent, you’ll want to transfer to the ‘Data’ tab.

Opening Site Health Info in WordPress

After that, head to the ‘Database’ segment and click on to increase it.

Within the Extension box, search for mysqli or mysql.

Look for extension info in database

In the event you see the sphere clean or now not visual in any respect, then it way you’re lacking the MySQL extension.

Now, the set up procedure for the extension depends on your WordPress web hosting supplier. You’ll merely succeed in out to them for assist or ask the beef up workforce to put in it for you.

4. Take a look at Your PHP Configuration

Differently to mend the PHP lacking MySQL extension error is to test your web site’s PHP settings.

Now and then, you may well be importing the fallacious php.ini document or the use of the fallacious document trail. This results in PHP configuration problems and lacking MySQL extension mistakes.

The php.ini document is a default configuration document for PHP and affects how your web site purposes. Importing the improper document normally occurs should you’re the use of a special working device. For instance, you may well be importing the php.ini document that’s supposed for Home windows on a Linux server.

To seek out the trail of your php.ini document within the phpinfo.php document, you’ll input the next internet deal with within the browser:

www.instance.com/phpinfo.php

Simply make sure you exchange www.instance.com together with your area identify.

Subsequent, you are going to see main points of your PHP set up.

View php installation details

From right here, you’ll scroll down and search for the ‘Configuration Document Trail’ or ‘Loaded Configuration Document’ fields.

If you find the php.ini document, merely connect with an FTP consumer, move to the document trail, and delete it to peer if it fixes the PHP lacking MySQL extension error.

View path of php ini file

Sooner than deleting, we propose making a backup of the present document via downloading it onto your pc. This manner, if the rest is going fallacious, you’ll repair the php.ini document and get admission to your site.

Bonus Sources for Solving WordPress Mistakes

Now that you realize about PHP lacking MySQL extension error, you’ll additionally take a look at our guides on resolving different WordPress mistakes:

We are hoping this text helped you learn to repair the PHP lacking MySQL extension error in WordPress. You may additionally wish to see our tricks to accelerate WordPress efficiency or our entire WordPress troubleshooting information.

In the event you preferred this text, then please subscribe to our YouTube Channel for WordPress video tutorials. You’ll additionally in finding us on Twitter and Fb.

The put up Easy methods to Repair “PHP Lacking MySQL Extension” Error in WordPress first seemed on WPBeginner.

WordPress Maintenance

[ continue ]