---
url: 'https://www.wpconsults.com/your-php-installation-appears-to-be-missing-the-mysql-extension/'
language: 'en'
title: 'How to Fix &#8220;Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress&#8221; Error'
author:
  name: 'Abdullah Nouman'
  url: 'https://www.wpconsults.com/author/nouman/'
date: '2024-02-01T20:13:00-06:00'
modified: '2026-07-18T22:16:56-05:00'
type: 'post'
categories:
  - 'WordPress Tips &amp; Tutorials'
image: 'https://www.wpconsults.com/wp-content/uploads/2024/01/how-to-fix-php-installation-appe-jpg.webp'
published: true
---

# How to Fix &#8220;Your PHP Installation Appears to Be Missing the MySQL Extension Which Is Required by WordPress&#8221; Error

This error means WordPress cannot talk to its database, because the PHP running on your server has no working MySQL driver loaded. It looks scary, but it almost always comes down to one thing: a mismatch between your PHP version and your WordPress version.

 

I will walk through every fix in the order I actually try them, from a one-click update to editing **php.ini**, and finish with the single change that stops this from ever coming back.

  

### Key Takeaways

 

- The message means PHP has no usable MySQL driver loaded, so WordPress cannot reach its database.
- The usual cause is a version mismatch: old WordPress on PHP 7 or higher, which dropped the original `mysql` extension in favor of MySQLi and PDO_MySQL.
- Work through it in order: update WordPress, check the `.htaccess`, then confirm and update your PHP version.
- If PHP is old, enable the `mysqli` extension from your host’s PHP selector, or ask the host to switch it on.
- If the extension is present but still failing, php.ini is usually pointing at the wrong extension directory.
- Managed WordPress hosting keeps PHP and its extensions current, which removes this whole class of error.

  Table of Contents

- What the PHP missing MySQL extension error actually means
- 1. Update WordPress first
- 2. Check your .htaccess file
- 3. Check and update your PHP version
- 4. Make sure the MySQL extension is enabled
- 5. Point php.ini at the right extension directory
- The permanent fix: hosting that keeps PHP current
- So which fix should you try first?
- Update Logs

 

## What the PHP missing MySQL extension error actually means

 

WordPress stores everything (your posts, users, settings) in a MySQL database, and it needs a PHP driver to read and write that data. When you see this message, that driver is not loaded, so WordPress hits a dead end before it can even show a page.

 

Here is the part most guides skip. PHP 7.0 removed the old `mysql_*` extension completely, and moved everyone to **MySQLi** and **PDO_MySQL**. So the error usually shows up when an old WordPress install (looking for the retired driver) lands on a modern PHP version that no longer ships it. You can read the deprecation note in the [official PHP MySQLi manual](https://www.php.net/manual/en/book.mysqli.php) if you want the detail.

 

That framing matters, because it tells you what to fix: either bring WordPress up to date so it stops asking for the old driver, or make sure the right MySQL extension is actually enabled on the server. Almost every case below is one of those two.

 

**Note:** before you change anything, take a full backup of your site. Every fix here is reversible, but a backup means you never have to gamble.

 

## 1. Update WordPress first

 

If your site runs an outdated WordPress on PHP 7 or higher, this is almost certainly your problem, so start here. Modern WordPress (3.9 and up) already uses MySQLi and PDO_MySQL, so simply updating the core often clears the error outright.

 

### Option 1: update from the dashboard

 

If you can still log in, this is a thirty-second job. Go to **Dashboard > Updates** and click **Update Now**, and WordPress downloads and installs the latest version for you.

 ![Updating WordPress from the dashboard to fix the PHP missing MySQL extension error](https://wpconsults.com/wp-content/uploads/2024/02/image-1024x385.png) 

### Option 2: update manually over FTP

 

If the error locks you out of the dashboard, you can still update by hand. You will need an FTP client like FileZilla and the FTP details from your host, then follow these steps in order so nothing important gets overwritten.

 

- Download the latest release from [wordpress.org/download](https://wordpress.org/download/) and unzip it on your computer.
- Connect to your server with the FTP client.
- Rename your existing **wp-includes** and **wp-admin** folders to something like **wp-includes.old** and **wp-admin.old**, as a safety net.
- Upload the fresh **wp-includes** and **wp-admin** folders from the download.
- Upload the loose files from the download’s root folder too, overwriting the old ones, but leave **wp-config.php** alone (that holds your database credentials).

 ![Uploading fresh WordPress core files over FTP](https://wpconsults.com/wp-content/uploads/2024/01/image-25.png) 

Then visit `yourdomain.com/wp-admin/upgrade.php` in your browser so WordPress can run any pending database updates. If a stale core was the cause, the site should load again at this point.

 

## 2. Check your .htaccess file

 

Sometimes a stray rule in `.htaccess` is forcing the wrong PHP handler, which loads a build of PHP that lacks the MySQL driver. It is a quick thing to rule out before you touch anything heavier.

 

Open your host’s file manager (in cPanel it sits under Files), edit the `.htaccess` in your site root, and look for any hard-coded PHP handler or AddType line like the one below. If it is there, remove it, save, and reload your site.

 ![A PHP handler line in the .htaccess file that can trigger the missing MySQL extension error](https://wpconsults.com/wp-content/uploads/2024/02/image-11.png) 

If your site lives on cPanel and you are comfortable in the file manager, the same panel is where you would handle other recovery jobs too, like when you need to [reset a WordPress password from the file manager](https://www.wpconsults.com/reset-wordpress-password-from-file-manager/).

 

## 3. Check and update your PHP version

 

If updating WordPress did not do it, the next question is which PHP version your server actually runs, because a very old or oddly configured PHP is the other common trigger. There are two easy ways to check.

 

### Option 1: from the WordPress dashboard

 

If you can log in, go to **Tools > Site Health > Info** and open the **Server** section. WordPress shows your current PHP version and warns you if it is out of date, which is the fastest read you can get.

 ![Checking the PHP version in WordPress Site Health](https://wpconsults.com/wp-content/uploads/2024/01/image-23.png) 

### Option 2: with a phpinfo file

 

Locked out of the dashboard? You can read the PHP details directly. In your **public_html** folder, create a file called **phpinfo.php** and add this:

 

```
<?php
phpinfo();
?>
```

 

Upload it, then visit `yourdomain.com/phpinfo.php`. You will get a full report of your PHP configuration, version included. Delete this file once you are done, since it exposes server details you do not want public.

 ![phpinfo output showing the PHP version](https://wpconsults.com/wp-content/uploads/2024/01/image-24.png) 

### Updating the PHP version

 

To move to a supported PHP release, log in to cPanel, open **Select PHP Version** (or PHP Selector), pick a current version, and save. WordPress lists its [recommended PHP version](https://wordpress.org/about/requirements/) on its requirements page, so match that rather than reaching for the absolute newest build, which the odd old plugin may not support yet.

 ![Choosing a PHP version in the cPanel PHP selector](https://wpconsults.com/wp-content/uploads/2024/01/image-26.png) 

## 4. Make sure the MySQL extension is enabled

 

On older PHP (5.6 and below, before the extension was removed), the driver can simply be switched off, and then WordPress cannot find it even though PHP itself is fine. So the fix here is to confirm it is enabled.

 

The quickest check is that same **phpinfo.php** page. Load it and search for a **mysqli** section; if it is there, the driver is active, and if it is missing, the driver is off or not installed.

 ![phpinfo page showing the mysqli extension section](https://wpconsults.com/wp-content/uploads/2024/01/image-27.png) 

To turn it on, go to **Select PHP Version > Extensions** in cPanel, tick **mysqli** (and **nd_mysqli** or **pdo_mysql** if listed), and save. On a shared host that has no toggle for it, contact support and ask them to enable the MySQL extension for your PHP version; it is a routine request they handle in minutes.

 ![Enabling the mysqli and pdo_mysql extensions in the cPanel PHP selector](https://wpconsults.com/wp-content/uploads/2024/02/image-8-1024x327.png)Tick the mysqli and pdo_mysql extensions, then save. 

## 5. Point php.ini at the right extension directory

 

If the extension is installed and enabled and you still see the error, the last suspect is php.ini looking in the wrong place for its extensions. This is rarer, and usually shows up after a server migration or a manual PHP change.

 

On your phpinfo page, find the **Loaded Configuration File** line and note that path; that is the php.ini in charge.

 ![Loaded Configuration File path shown in phpinfo](https://wpconsults.com/wp-content/uploads/2024/02/image-9.png) 

Now find the **extension_dir** row, which is where PHP looks for the driver files. If that folder does not match reality (or the drivers are not in it), that mismatch is your bug.

 ![extension_dir path shown in phpinfo](https://wpconsults.com/wp-content/uploads/2024/02/image-10.png) 

Open that php.ini and make sure `extension_dir` points to the real extensions folder, with `extension=mysqli` uncommented. If you are unsure which php.ini WordPress is even using, this [Stack Overflow thread on locating php.ini](https://stackoverflow.com/questions/6165558/how-can-i-find-my-php-ini-on-wordpress) is a solid reference. Save, reload, and the error should be gone. If your database itself is the worry rather than PHP, my guide on [how to find your WordPress database](https://www.wpconsults.com/find-wordpress-database/) helps you confirm the connection details in wp-config.php.

 

## The permanent fix: hosting that keeps PHP current

 

Every fix above is a reaction to a server that fell out of step. On good managed WordPress hosting you rarely meet this error at all, because the host keeps PHP, its extensions, and the WordPress-side requirements aligned for you, and flags a version bump before it breaks anything.

 

If you are weighing a move, the two I keep coming back to are [Hostinger](https://www.hostg.xyz/SHDB4) on the budget side and [Cloudways](https://www.cloudways.com/en/?id=1410227) when you want more room to scale. I have run sites on both for years, and the version management genuinely takes this class of problem off your plate. That said, cheap shared hosting can work fine if you stay on top of updates yourself; the difference is who does the babysitting.

 

Readers get 20% off for 2 months on [Cloudways](https://www.cloudways.com/en/?id=1410227) with the promo code **WpConsults2024**.

 

## So which fix should you try first?

 

Honestly, nine times out of ten this is a version mismatch, so I start by updating WordPress and, if that fails, checking the PHP version and enabling `mysqli`. Those three steps clear almost every case, and the php.ini fix is the fallback for the stubborn ones after a migration.

 

My honest view is that if this error keeps returning, the site is telling you the hosting is the real problem, not the code. Fix it once with the steps above, and if it comes back a second time, that is your cue to move to a host that manages PHP for you.

  

### Still stuck on the missing MySQL extension error?

 

If you have worked through every fix and WordPress still cannot load the MySQL extension, [contact us](https://www.wpconsults.com/work-with-wpconsults/) or [email me](mailto:abdullah@wpconsults.com) and I will take a look. A stable database connection is the baseline for a healthy WordPress site, so it is worth getting right.

   

## Update Logs

 

**01 Jul 2026**

 

- Rewrote the guide around why the error happens (PHP 7 dropping the old mysql driver for MySQLi), reordered the fixes into the sequence I actually use, and refreshed the PHP-version and hosting guidance with current references.
