If you are facing the PHP error message: “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”, don’t worry, you’re not alone. This is a common error that can occur for several reasons.

In this blog post, we will walk you through how to fix your PHP installation so you can get your WordPress site up and running.

Your php installation appears to be missing the mysql extension which is required by WordPress error

How can you tell if you have the “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” error?

If you see that exact message, “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” when you go the access your WordPress website via a web browser.

What is the “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” error and what does it mean for your website or blog?

The error message is a warning that the PHP version on your site is not compatible with the PHP version of WordPress requires. This is because the MySQL extension has changed across PHP versions and you have an outdated MySQL extension.

The PHP MySQL extension needs to be installed or updated. PHP 7+ no longer includes the MySQL extension.

Newer versions of WordPress use different extensions. Below version 3.9, you might see this issue.

How can you solve the “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” problem so that your website or blog will work properly again?

You may need to update WordPress to a newer version or reinstall WordPress as there might have been some kind of corruption in your WordPress files.

Or, you need to upgrade or install the missing MySQL extension for your PHP version.

Once you have done that, your WordPress site or blog should work like normal again.

How do you install/upgrade the MySQL extension for PHP?

Check PHP Versions

There are a few ways to do this:

Upload a file containing a php code snippet by doing the following:

First, you create a phpinfo.php file containing the following on your local machine. (php phpinfo() provides you with information on your PHP installation and PHP configuration.

<?php phpinfo();?>

If you have cPanel, you can use the cPanel File Manager tool to upload the following file.

If you have SFTP access, connect with your ftp client (FileZilla, for example)

Either way, save the phpinfo.php file in your WordPress root directory. Then access the file with your web browser: {mysite.com}/phpinfo.php. Replace the braces and the URL inside with your domain name. In your web browser you should see your systems php data.

If you don’t have access to either of those options and you have SSH access you can connect to your server via SSH to check the PHP version.

Once there run:

php -v

Any of these methods should return the PHP version currently running. For example PHP version 7.2.25 or 5.6.7.

Update Required Packages

Upgrade to Newer WordPress

Software Version

If the server is running PHP 7+, the issue is you are not using a current version of WordPress and it’s looking for a file that’s no longer there. I highly recommend upgrading the latest version of WordPress in this case. There are many security and functionality upgrades from older version which you should avail of.

If you cannot upgrade the WordPress version then there are some other options.

PHP 7.x.x

With Ubuntu, run the following in SSH

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

For CentOS run the following:

yum update
yum install php70w-mysql

PHP 5.x

With Ubuntu, run the following in SSH:

apt-get update
apt-get install php-mysql

For CentOS run the following:

yum update
yum install php53-mysql

Restart Apache Web Server

If you have access to do this, restart the Apache service.

If you are using Nginx + PHP-FPM, restart the PHP-PHM service.

How can you prevent it from happening in the future?

Once you have upgraded WordPress or have installed the PHP package you should not see this again.

Or you can switch to a hosting provider which ensures this problem will not happen.

If you are unable to solve the “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” error yourself, who can help you fix the problem?

I would contact your hosting provider to see if they have any more specific instructions. There are a lot of hosting providers out there and I cannot cover all the scenarios for all of them.

Is there anything else you should do after solving the “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” on your website or blog?

I would test your site to make sure it’s working fine. You should check log in, view the WordPress dashboard, create a post or page and make sure it displays correctly.

What Does the PHP MySQL Extension Do?

The MySQL extension is used to connect WordPress and PHP to your MySQL database. The MySQL database is where all of your WordPress information is stored. If WordPress does not have access to the MySQL database, then WordPress will not function correctly.

Summary

In this blog post I have gone over several ways in which you could solve the issue with “Your php installation appears to be missing the mysql extension which is required by WordPress” error. Check out my review of Convesio, which is the best WordPress Hosting site I have found.