CALL 1.800.975.6814    LIVE CHAT

@dailyrazor Blog

Fixing: Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

June 5 2018 0
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

So you’ve finally come across the dreaded “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.” error message.

Not to worry, you’re not a lone.

We often get inquiries on this error message and we’ve created this article to assist you in troubleshooting and resolving the issue quickly.

And this issue is not only limited to a newly migrated WordPress website but also to existing one as a result of a change in server configuration.

On the contrary, there are several reasons why you’re getting this error message and we’ll go through them one by.

So let the troubleshooting begin!

How to Fix: Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

 

[SPECIAL OFFER]: Lightning Fast VPS Hosting

[BENEFITS]:

  • Expert VPS Hosting Provider
  • Root Access to Run Any Software Stack
  • Professional Linux Administrators on Hand
  • 24/7/365 Technical Support

Click here to access this [SPECIAL OFFER]

 

1. Check if PHP’s MySQL extension is installed. If it’s not, then install it!

If PHP is to communicate SQL commands to and retrieve responses from MySQL; it needs the MySQL extension installed.

Therefore, this is an additional module to PHP; and as such the extension may not be set up by default in some default OS installations.

By the same token, the quickest and easily to check if PHP’s MySQL extension is installed when troubleshooting the Your PHP installation appears to be missing the MySQL extension which is required by WordPress.” error message is by creating an info.php file.

Hence, simply open up your favorite text editor and enter the following code:

<?
phpinfo();
?>

And save the file as info.php and upload it to the root directory of your web hosting server.

Then open up the page on your web browser by visiting http://www.yourdomainname.com/info.php.

Accordingly, this page will show you all the details pertaining your PHP installation.

Notably, of particular importance is the mysql section which should look like this:

your php installation appears to be missing the mysql extension which is required by wordpress.

In effect, The MySQL version should be shown next to the Client API version.

If it’s not shown there, then you don’t have the PHP’s MySQL extension installed.

 

[SPECIAL OFFER]: Lightning Fast VPS Hosting

[BENEFITS]:

  • Expert VPS Hosting Provider
  • Root Access to Run Any Software Stack
  • Professional Linux Administrators on Hand
  • 24/7/365 Technical Support

Click here to access this [SPECIAL OFFER]

 

PHP’s MySQL Installation on RedHat Compatible Servers

If you’re running a RedHat compatible server such as CentOS, run the following commands depending on your PHP version:

PHP 5:


# yum update
# yum install php-mysql

PHP 7:


# yum update
# yum install php70w-mysql

Then restart the server for the changes to take effect.

Now check and see if the error has gone away.

If not, let’s proceed to the second step of the troubleshooting processing.

PHP’s MySQL Installation on Ubuntu servers

If you’re running an Ubuntu server, run he following commands depending on your PHP version:

PHP 5:


# apt-get update
# apt-get install php5-mysqlnd

PHP 7:


# apt-get update
# apt-get install php7.0-mysql

Then restart the server for the changes to take effect.

Now check and see if the error has gone away.

If not, let’s proceed to the second step of the troubleshooting processing.

 

[SPECIAL OFFER]: Lightning Fast VPS Hosting

[BENEFITS]:

  • Expert VPS Hosting Provider
  • Root Access to Run Any Software Stack
  • Professional Linux Administrators on Hand
  • 24/7/365 Technical Support

Click here to access this [SPECIAL OFFER]

 

2. Check if PHP’s MySQL extension directory is misconfigured. If it is, then fix it!

Ultimately, you’ve checked to see if PHP’s MySQL extension is installed as directed in Step 1 and it is. However, the error message is still there.

In that case, another cause of the Your PHP installation appears to be missing the MySQL extension which is required by WordPress. could be that the PHP extension directory is not configured properly, if configured at all.

That can be the case especially with newly provisioned VPS or Dedicated Servers; or sometimes with recently migrated WordPress sites.

In order to fix this, locate which PHP.ini file is being loaded and ensure that the appropriate “extension_dir” value is being used.

So let’s open up the info.php file we created in Step 1 via our web browser.

Then locate the parameter called “Loaded Configuration File“. Note: you can to CTRL F to use the browser’s Find function to locate this.

Take note of the file path value to the Loaded Configuration File parameter. Here’s an example:

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

Next, locate the entry for the “extension_dir” parameter. It should not be blank. And most importantly, it should have the correct path to the PHP extensions.

This is very important if you have multiple versions of PHP on your server.

Here’s an example:

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

Looking at the values of the “Loaded Configuration File” parameter and that of the “extension_dir” parameter, you’ll see that “extension_dir” is pointing to the correct extension directory path for the PHP version installed.

If the “extension_dir” is pointing to the incorrect location, then open up the PHP.ini file and fix it by applying the correct value.

 

[SPECIAL OFFER]: Lightning Fast VPS Hosting

[BENEFITS]:

  • Expert VPS Hosting Provider
  • Root Access to Run Any Software Stack
  • Professional Linux Administrators on Hand
  • 24/7/365 Technical Support

Click here to access this [SPECIAL OFFER]