Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Fix “PHP Missing MySQL Extension” Error in WordPress

In WordPress, you will run into the ‘your PHP installation appears to be missing the MySQL extension which is required by WordPress’ error every now and then.

When this error appears, it prevents users from viewing your website. If it occurs frequently, then it can be bad for your site’s user experience.

Over the years, we have experienced this error on multiple occasions on WPBeginner and some of our other brand websites.

From our experience, we learned that you can fix this error by checking the PHP version and updating WordPress. You can also check the PHP settings and ensure that the MySQL extension is installed.

In this article, we will show you how to fix PHP missing MySQL extension error in WordPress.

How to fix PHP missing MySQL extension error

What Is the PHP Missing MySQL Extension Error?

When you’re working on building a WordPress website or visiting a web page, you may come across the ‘your PHP installation appears to be missing the MySQL extension which is required by WordPress’ error.

This error usually means that something went wrong with your site’s code and it’s preventing WordPress from connecting to its MySQL database.

The PHP missing MySQL extension error usually appears when you update or install WordPress, migrate a website, change server configurations, or switch operating systems that don’t have a MySQL extension (like Linux).

That said, let’s see the causes for this error.

What Causes the PHP Missing MySQL Extension Error?

There are multiple reasons why a PHP missing MySQL extension error may occur.

One of them is that you are using an outdated version of WordPress with the latest PHP version. If you’re using PHP 7.0 or higher, then you should know that it deprecated the MySQL extension.

So, if you have an older version of WordPress that’s working with PHP 7.0 or higher, then it won’t find the MySQL extension and cause this error.

Another reason why you might see this error is that the MySQL extension is either missing or not properly configured. Even if you’re using PHP 5.6 or lower, the PHP missing MySQL extension error can still occur due to an outdated MySQL extension.

Now, let’s see some of the ways you can fix the ‘your PHP installation appears to be missing the MySQL extension which is required by WordPress’ error.

You can use the links below to check out any of the tips you’d like:

Fixing the PHP Missing MySQL Extension Error in WordPress

Now that you know what causes this WordPress error, here are some of the ways to fix it.

1. Check The PHP Version You Are Using

The first thing you can do is check the PHP version of your website. A conflict between WordPress and PHP version usually results in the PHP missing MySQL extension error.

To start, you can head to the Tools » Site Health page from the WordPress dashboard. From here, simply switch to the ‘Info’ tab.

Opening Site Health Info in WordPress

After that, you can scroll down to the ‘Server’ section and click to expand it. Here, you’ll see the server information for your website.

Go ahead and view the PHP version details.

Check PHP version

If your site’s PHP version starts with 7 or lower, then it means you’ll need to update it. This can solve the PHP missing MySQL extension error as it would be compatible with the latest WordPress version.

We highly recommend using PHP 8.0 or the latest version because it will safeguard your site from security threats. Plus, it will also optimize your site’s performance and fix any security vulnerabilities and bugs.

You can learn more by following our guide on how to update your PHP version in WordPress.

2. Update WordPress to the Latest Version

After checking the PHP version, you can also see which WordPress version you’re using.

If it is an older version and you’re running the latest PHP version, then consider updating WordPress to resolve the PHP missing MySQL extension error.

A simple way to check the WordPress version is by going to Dashboard » Updates from the WordPress admin panel. Here, look for the ‘Current version’ information.

Check wordpress version

If the WordPress version is 3.9 or lower, then we recommend updating it to fix the missing MySQL extension error.

The best thing is that WordPress comes with a built-in update manager. You can update to the latest version with a click of a button.

WordPress updates

To learn more, please see our guide on how to safely update WordPress.

3. Ensure You Have MySQL Extension Installed

Now that you have updated the PHP version and WordPress on your website and are still facing the ‘PHP missing MySQL extension’ error, then you need to check if the MySQL extension is correctly installed on your site.

You can do that by going to the Tools » Site Health page from the WordPress dashboard. Next, you’ll need to switch to the ‘Info’ tab.

Opening Site Health Info in WordPress

After that, head to the ‘Database’ section and click to expand it.

In the Extension field, look for mysqli or mysql.

Look for extension info in database

If you see the field blank or not visible at all, then it means you’re missing the MySQL extension.

Now, the installation process for the extension will depend on your WordPress hosting provider. You can simply reach out to them for help or ask the support team to install it for you.

4. Check Your PHP Configuration

Another way to fix the PHP missing MySQL extension error is to check your site’s PHP settings.

At times, you might be uploading the wrong php.ini file or using the wrong file path. This leads to PHP configuration issues and missing MySQL extension errors.

The php.ini file is a default configuration file for PHP and impacts how your site functions. Uploading the incorrect file usually happens if you’re using a different operating system. For example, you might be uploading the php.ini file that’s intended for Windows on a Linux server.

To find the path of your php.ini file in the phpinfo.php file, you can enter the following web address in the browser:

www.example.com/phpinfo.php

Just make sure to replace www.example.com with your domain name.

Next, you will see details of your PHP installation.

View php installation details

From here, you can scroll down and look for the ‘Configuration File Path’ or ‘Loaded Configuration File’ fields.

Once you locate the php.ini file, simply connect to an FTP client, go to the file path, and delete it to see if it fixes the PHP missing MySQL extension error.

View path of php ini file

Before deleting, we recommend creating a backup of the existing file by downloading it onto your computer. This way, if anything goes wrong, you can restore the php.ini file and access your website.

Bonus: Resources for Fixing WordPress Errors

Now that you know about PHP missing MySQL extension error, you can also check out our guides on resolving other WordPress errors:

We hope this article helped you learn how to fix the PHP missing MySQL extension error in WordPress. You may also want to see our guide on how to fix missing a temporary folder error in WordPress and what is 414 request URI too long error and how to fix it.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

7 CommentsLeave a Reply

  1. Moinuddin Waheed

    Thank you for this tutorial about MySQL missing extension from the php version.
    Usually we don’t give heed to these detailes about the versions we are using and install and start using wordpress.
    Most often it is taken care by the server configuration.
    I would like to ask if we need to check it even if we don’t have any issue ?
    or is there any specific guidelines regarding php versions (latest version and most stable version)

    • WPBeginner Support

      If you do not have the error you would not normally need to check for this unless there is a feature you need that would require a newer version of PHP.

      Admin

      • Moinuddin Waheed

        Thank you for your response.
        i used to think about the stable and newer version of php and often wondered whether should I be using newer version of stable one.
        Thanks, this clarifies that unless otherwise i need the newer version, i should be using the default stable version of PHP.

  2. Kzain

    Thank you so much for this. While the general steps provided in the article are helpful, each hosting provider might have its own way of managing PHP extensions. Also, keeping your WordPress installation and plugins updated can help prevent this error from occurring in the first place. Outdated software can sometimes lead to compatibility issues.

  3. Jiří Vaněk

    I looked at my PHP version now and I have version 8.0. Is there any reason, such as speed or the possibility of similar errors, that I should now upgrade to a higher version of PHP (8.2 or 8.3)? Or version 8 (both PHP and MySQL) is enough to avoid this error (with the current version of WordPress).

    • WPBeginner Support

      Not specifically at the moment unless a tool you are using on your site is requiring a higher version of PHP

      Admin

      • Jiří Vaněk

        Thank you for your response. I’ve been considering whether to upgrade the version, but I was afraid that some website components like plugins or snippets might not be compatible. For now, I’ll postpone the upgrade, and I appreciate the reassurance that it should be okay as it is for the time being, and the upgrade isn’t strictly necessary.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.