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

your php installation appears to be missing the mysql extension

If you have received the “Your PHP installation appears to be missing the MySQL extension which Is required by WordPress” error, then this tutorial will be able to help you fix that. This error is triggered when the PHP code in your site is not compatible with the version of PHP your WordPress site is currently using.

More specifically, this problem is related to the outdated MySQL extension which was removed as of PHP 7.0. In this tutorial, we will help you fix the problem with the PHP missing MySQL extension error, and help you complete the WordPress installation successfully.

Missing a PHP extension is not something you should be worried about. If you see the following message on your screen when trying to access the WordPress installation via a web browser, then you are one of the many WordPress users facing the same error.

The error that you see should look like this:

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

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

1. Connect via SSH and check the PHP version

To fix the problem, you should have SSH access to the server. Connect to your Linux VPS via SSH and check the PHP version which is currently in use:

php -v

2. Create Info.php file

You can also check the PHP version by creating a simple info.php file in your public_html directory with the following content:

<?php phpinfo(); ?>

Once you create the file, open your favorite web browser and access the file.

3. Update the required packages

If you are running an Ubuntu VPS and PHP 7, then run the following commands:

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

Installing a later version of PHP and the PHP MySQL extension should help you avoid the “PHP installation is missing the MySQL extension” error.

4. Restart the Web Server

Then restart your Apache service for the changes to take effect, or if you are using Nginx + PHP-FPM, then restart the PHP-FPM service.

5. Update PHP

In case you are running PHP 5, run the following commands:

apt-get update
apt-get install php-mysql

Restart the appropriate service for the changes to take effect.

php installation appears to be missing the mysql extension

6. Search all the available packages containing MySQL

To search all the available packages containing mysql, you can use this command:

apt-cache search mysql

On the other hand, if you are running a CentOS VPS and you have PHP 7 installed on the server, then run the following commands to fix the problem:

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS
yum update
yum install php70w-mysql

7. Restart Apache

Restart Apache or the PHP-FPM service in case you are using Nginx + PHP-FPM as a web server.

If you have PHP 5 installed on your CentOS server, run the following commands:

yum update
yum install php-mysql

Restart the appropriate service for the changes to take effect.

To search for all the available packages containing mysql, you can use the following command:

yum search mysql

PHP Extension for MySQL is Now Fixed

Once you install the MySQL extension for PHP, you can return back to your WordPress setup. If the installation went OK, the message about the missing MySQL extension should not be presented to you. You can now continue with your WordPress setup!


PHP installation appears to be missing the MySQL extension

Of course, you don’t have to Fix the Your PHP installation appears to be missing the MySQL extension if you use one of our MySQL VPS Hosting services, in which case you can simply ask our expert Linux admins to help you Fix the Missing MySQL Extension Error in WordPress or install any other required PHP extension. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to fix the “Your PHP installation appears to be missing the MySQL extension” error,  please share it with your friends on social networks or simply leave a reply below. Thanks.

13 thoughts on “Your PHP installation appears to be missing the MySQL extension which Is required by WordPress”

  1. This error was caused because I was using an old version of WordPress 3.5?? – I fixed it by installing by installing wp-cli on the Bash command line then used wp-cli to do a WordPress upgrade to the current version. Reloaded the browser a couple of times and it worked like magic.

    Reply
  2. Hi, I followed your instructions and they worked well. I finally fixed this problem that was affecting 9 websites that I manage. Thanks for the info.

    Reply
  3. PHP7,.0, at least on Ubuntu Server 16.04 LTS, doesn’t provide a MySQL module anymore. It been deprecated for some time, and has been removed altogether in PHP 7,0. The php7.0-mysql package installs the MySQLi (“MySQL Improved”) module instead, for which the API is somewhat different. If your WordPress installation was installed over PHP5, using its MySQL module it may need to be upgraded or adjusted to use MySQLi module instead of the older one.

    Reply
    • How do I do the upgrade? I am asking because I cannot be able to log into wordpress wp-admin. I keep getting the same error

      Reply
      • If you have followed our tutorial, and you updated the PHP version you also need to restart the web server with “service name restart” where name is the web service you are using

        Reply
    • You have to enter the commands on command line. You need to connect to your server through SSH using an SSH client. Log in with a user that has root privileges.

      Reply
  4. I have migrated my 1 website in another webserver but my site is created in php 5.3 and my migrated site is php 7.1. If my going to update using this command
    -yum update
    -yum install php70w-mysql
    it will not be affect my other site which also located on this server?

    Reply
  5. Since the MySQL extension is deprecated (no longer supported) from PHP 7.0 and beyond, changing your PHP version to 5.6 or lower will fix the issue.

    Reply

Leave a Comment