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

December 6, 2023

post-thumnail

Quick Fix for

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

Here, we’ll share a quick fix for cPanel & DirectAdmin both web hosting control panels.

The solution is simple and will resolve your problem in matter of minutes.

WordPress, being one of the most popular content management systems, may sometimes encounter an error message stating, “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.” This issue typically arises due to the absence or misconfiguration of the MySQL extension in the PHP setup. Here’s a guide to rectify this problem in cPanel and DirectAdmin hosting environments.

Let’s quickly dive into the solution.

For cPanel:

  1. Access cPanel File Manager:

    • Log in to your cPanel account.
    • Navigate to the File Manager under the Files section.
  2. Edit the PHP Configuration File (php.ini):

    • Locate the php.ini file. If it doesn’t exist, you might find php.ini sample files like php.ini.default.
    • Right-click on the file and select “Edit” or “Code Edit” from the context menu.
    • Search for the line ;extension=mysqli or ;extension=mysql.
    • Remove the semicolon ; at the beginning of the line to uncomment it.
    • Save the changes made to the php.ini file.
  3. Verify PHP Configuration:

  • Create a new PHP file (e.g., info.php) containing:

<?php phpinfo(); ?>

  • Access this file through a browser (e.g., http://yourdomain.com/info.php).
  • Check for the MySQL/Mysqli extension in the PHP configuration to confirm if it’s enabled.

      Restart Apache:

    • After editing the php.ini file, restart the Apache web server through cPanel or using the command line to apply the changes.

For DirectAdmin:

  • Login into your directadmin hosting control panel
  • Goto “Select PHP version” option in your DirectAdmin panel.select php version - mysql php ext issue
  • Make sure to enable these 3 php extentions regarding mysql

    mysql php extentions enabled

  • pdo_mysql
  • mysqlnd
  • nd_mysqli

After this, please Refresh the WP website / Or / installation page of wp, and you’ll see that this error is resolved.

I hope this tutorial will fix the issue for you. Do share with your friends and colleagues. 

Leave a 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.

Our mission is to make life easier for website developers and their customers. We do it by offering easy to use, fast and reliable web hosting services in very affordable rates.

ELYSIUM TECHNOLOGY SOLUTIONS LTD.

(UK Company Registered number: 15129715)

Useful Pages

Hosting Types

Contacts

Made with love in Pakistan. 2015 – 2024 © Copyrights reserved Elysium Technology Solutions Ltd.