• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero Blog

NameHero Blog

Web Hosting Tips & Resources From NameHero

  • Web Hosting
  • Reseller Hosting
  • Managed Cloud
  • Domains
  • Account
  • Blog Home
  • Categories

How To Fix The “Your PHP installation appears to be missing the MYSQL extension which is required by WordPress” Error

Michael Flores Feliz

Published on: March 3, 2023

Categories: WordPress 1

In this article, we’ll talk about a few different ways that you can fix this error by enabling the MySQL extension on your server using the command line, cPanel, WHM, SiteWorx, or NodeWorx. We’ll also cover how to confirm that the installation was successful, and if you’re still having errors, we’ll show you what else to check.

This image has an empty alt attribute; its file name is image-4-1024x119.png

After completing these steps, WordPress should be able to connect to your MySQL database. Without the PHP MySQL extension, PHP would not be able to communicate with MySQL databases. This would severely limit the functionality of PHP-based applications that require database access, such as WordPress. Let’s start with the basics.

  • What Is The PHP MySQL Extension?
  • What Does The Error “Your PHP installation appears to be missing the MYSQL extension which is required by WordPress” Mean?
  • 5 Ways To Solve “Your PHP installation appears to be missing the MYSQL extension which is required by WordPress”
    • #1: Install the PHP MySQL Extension Via The Linux Command Line
    • #2: Install the PHP MySQL Extension Via Web Host Manager (WHM)
    • #3: Install the PHP MySQL Extension Via cPanel
    • #4: Install the PHP MySQL Extension Via NodeWorx
    • #5: Install the PHP MySQL Extension Via SiteWorx
  • How To Check If You Install PHP MySQL Extension Correctly
  • Still Having Trouble? Here’s A Few More Things To Check
    • The MySQL extension is not enabled
    • The MySQL extension is not compatible
    • The MySQL server is not running

What Is The PHP MySQL Extension?

The PHP MySQL extension is a module that provides a set of functions for PHP to connect to and interact with MySQL databases. These functions allow PHP to establish a connection to the database server, execute SQL queries, retrieve query results, and perform other database-related tasks.

Fortunately, the PHP MySQL extension is widely available and easy to install. Most web hosting providers include the extension as part of their standard PHP installation, and it can be installed on a server manually if needed. Once installed, the extension allows PHP to communicate with MySQL databases and enable powerful database-driven web applications.

What Does The Error “Your PHP installation appears to be missing the MYSQL extension which is required by WordPress” Mean?

This error message typically indicates that the PHP MySQL extension is not installed or enabled on your server. So how do you install or enable it? There are a few different ways…

5 Ways To Solve “Your PHP installation appears to be missing the MYSQL extension which is required by WordPress”

To resolve this issue, you will need to install the PHP MySQL extension. There are five different ways to install the extension.

#1: Install the PHP MySQL Extension Via The Linux Command Line

Here are the steps to install it on a typical Linux-based server:

  1. Open a terminal or SSH connection to your server.
  2. Run the following command to install the PHP MySQL extension:

    For PHP 8.x:
    sudo yum install php8.x-mysql

    For PHP 7.x:
    sudo yum install php7.x-mysql

    For PHP 5.x:
    sudo yum install php5.x-mysql

    Replace x with the version of PHP installed on your server.
  3. Once the installation is complete, restart your web server to enable the extension. For example, if you’re using Apache, you can use the following command:

    sudo service apache2 restart

sudo service httpd restart

Disclaimer, may need to have your web host provider or admin run this commands as it installs extensions globally.

#2: Install the PHP MySQL Extension Via Web Host Manager (WHM)

If you have access to WHM (Web Host Manager), you can install the PHP MySQL extension using the EasyApache tool. Here are the steps to install the extension via WHM:

  1. Log in to WHM as the root user.
  2. Navigate to the “Software” section and click on “EasyApache 4”.
  1. Select your current Apache configuration and click on the “Customize” button.
  2. Click on the “PHP Extensions” tab.
  3. In the search bar, type “mysqli” or “mysqlnd” to locate the PHP MySQL extension.
  4. Check the box next to the “mysqli” or “mysqlnd” extension to enable it.
In this case, the server has Cloudlinux installed, by default, it will use cpanel repository.
  1. Click on the “Review” button to review the changes.
  2. Click on the “Provision” button to apply the changes and install the extension.

#3: Install the PHP MySQL Extension Via cPanel

If you are using cPanel to manage your web hosting account, you can install the PHP MySQL extension through the cPanel interface. Here are the steps to install the extension via cPanel:

  1. Log in to your cPanel account.
  2. In the “Software” section, click on “Select PHP Version”.
  3. In the top right corner, click on the “Switch to PHP Options” button.
  4. Look for the “mysqli” and “mysqlnd” extensions in the list and ensure that they are checked. If they are not, check the boxes next to them to enable them.
  5. Click on the “Save” button at the bottom of the page to apply the changes.

If you learn by watching, check out our video on this process.

#4: Install the PHP MySQL Extension Via NodeWorx

If you have access to the NodeWorx interface in InterWorx, you can install the PHP MySQL extension using the PHP Configuration Editor. Here are the steps to install the extension via NodeWorx:

  1. Log in to your NodeWorx account.
  2. Click on “Server” in the main menu and select “PHP Configuration Editor”.
  3. Select the PHP version you want to configure from the dropdown menu at the top of the page.
  4. Look for the “mysqli” and “mysqlnd” extensions in the list. If they are not listed, click on the “Show All” button to display all available extensions.
  5. Check the boxes next to the “mysqli” and “mysqlnd” extensions to enable them.
  6. Click on the “Save Changes” button at the bottom of the page to apply the changes.

#5: Install the PHP MySQL Extension Via SiteWorx

You can also do it from within Siteworx too! Here are the steps to install the extension via SiteWorx:

  1. Log in to your SiteWorx account.
  2. Click on “PHP Settings” under the “SiteWorx” section.
  3. Click on the “PHP Modules” tab.
  4. Look for the “mysqli” and “mysqlnd” extensions in the list. If they are not listed, click on the “Show More” button to display additional modules.
  5. Check the boxes next to the “mysqli” and “mysqlnd” extensions to enable them.
  6. Click on the “Save” button at the bottom of the page to apply the changes.

How To Check If You Install PHP MySQL Extension Correctly

Once you have completed these steps, the PHP MySQL extension should be installed and enabled on your server. You can verify this by creating a PHP script with the following code:

<?php phpinfo(); ?>

The file can be named anything but needs to end with “.php”. This script will display detailed information about your PHP installation, including a list of enabled extensions. If the MySQL extension is installed and enabled, it should be listed in the output of the phpinfo() function.

Still Having Trouble? Here’s A Few More Things To Check

If you already have PHP and the MySQL extension installed, but you are still getting the error message “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”, there may be a few reasons for this:

The MySQL extension is not enabled

Even though the MySQL extension is installed, it may not be enabled in your PHP configuration. You can check your PHP configuration to see if the extension is enabled.

If the MySQL extension is not listed, you need to enable it in your PHP configuration.

The MySQL extension is not compatible

If you have updated your PHP version recently, the MySQL extension may no longer be compatible with your new version of PHP. In this case, you may need to switch to a different MySQL extension, such as “mysqli” or “PDO MySQL”.

The MySQL server is not running

If your MySQL server is not running or is not properly configured, PHP will not be able to establish a connection to it. You may need to start or restart the MySQL server and make sure it is properly configured.

In any case, it is recommended to check the error logs on your server to get more information about the specific issue you are experiencing. The error logs should give you more details about what is causing the problem and how to fix it.

Michael Flores Feliz

An ambitious Linux programmer whose been in web hosting for 6 years, currently working at as a Linux System Administrator. I’ve designed WordPress, Drupal and Joomla sites through contract work or on my break from working too much. Work-a-holic and tend to be connected almost 24/7 (I like it). I really enjoy creating automation scripts as it tends to make life easier. My goal is dive into the world of DevOps and be able to manage datacenters.

Reader Interactions

Comments

  1. Munashe Tombo says

    March 18, 2023 at 3:01 pm

    This is very helpful, once experienced that error. Now solved. But can you also explain or document how to fix style sheet error in WordPress.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!

Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup (2023)

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

How To Inline And Defer CSS On WordPress Without Plugins

Top Categories

  • WordPress
  • Website Performance
  • Web Hosting
  • Resellers
  • Website Security
  • VPS Hosting
  • Website Development
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Name Hero
  • Web Hosting
  • Reseller Hosting
  • Managed Cloud
  • Domains
Help & Support
  • NameHero Blog
  • Knowledgebase
  • Announcements
  • Affiliates
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2023 NameHero, LLC. All rights reserved.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA