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

If you find yourself in a situation that requires changes to your site, and your developer isn't available to help, DreamHost's skilled support team may be able to assist you for a small fee. You can find more information about supported services and associated costs in the DreamHost Professional Services article.

Overview

When visiting your WordPress site, it's possible you may see this error:

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

This is caused when the PHP code in your site is not compatible with the version of PHP your site is currently using. More specifically, the issue is with the outdated MySQL extension which was removed as of PHP 7.0.

  • https://www.php.net/manual/en/intro.mysql.php

If you're using any version of PHP above 7.0 and you're seeing this error, it's due to old code that needs to be updated. You will need to upgrade the core WordPress files to the current version, as well as any plugins your site is using.

Check which version of PHP you're site is using

First, check which version of PHP your site is using with a phpinfo.php file.

  • Viewing your site's PHP version and settings

Make sure it matches the version of PHP your panel shows for your domain.

  • What version of PHP is my site using?

Updating your code

If your website has been upgraded to a version of PHP over 7.0 and you're seeing this error, it means you must update your WordPress core version and plugins to use the newer MySQLi or PDO_MySQL extensions instead.

  • https://www.php.net/manual/en/mysql.requirements.php

Updating WordPress

All One-Click installs in the panel are always set to update automatically (unless you specifically turn it off).

You can update your plugins in your dashboard:

  • Updating WordPress plugins

If you've manually installed WordPress, see the following article for instructions on how to update:

  • Manually updating WordPress

For Dedicated servers

If you're on a Dedicated server, your MySQL version may be 5.6. If so, and you're seeing this error, add the following line to your site's phprc file.

extension = mysql.so

View the following article for instructions on how to add this information:

  • How to add PHP extensions and loaders

See also

  • How to log into your WordPress site
  • Viewing your site's PHP version and settings
  • What version of PHP is my site using?
  • Creating and editing a file via FTP
  • Creating and editing a file via SSH
  • php.ini overview

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?