Loading...

Knowledge Base

Fixing Error After MultiPHP Update

This article explains how to resolve a WordPress issue that may look similar to the example below:

Missing MySQL Extension Error
 

The error message typically starts with:

"Warning: Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in"

It will reference a path inside your cPanel directory, followed by:

"Your PHP installation appears to be missing the MySQL extension, which WordPress requires."

Fixing this issue requires accessing the File Manager and editing certain files. If you are not comfortable doing this, our Support team will assist you via phone or chat.

Below are the sections covered in this guide.

How to fix the "Missing MySQL Extension" error

This solution applies if you originally used the PHP Selector to manage your PHP version and recently switched to the new MultiPHP Manager. The minimum PHP version on Shared Hosting servers is now PHP 8.1.
  1. Log in to your Bluehost Portal.
  2. In the left-hand menu, click Websites.
  3. Click the Manage button located next to the website you want to manage.

    Bluehost Portal - Website Manage button
     

  1. Click File Manager.

    Files - File Manager
     

  2. Find and open your website's document root. (In this example, we’re using the public_html folder.)

    File Manager - public_html
     

  3. Locate the .htaccess file, right-click it, and select View.

    To locate the .htaccess file:

    1. Click File Manager.

      Files - File Manager
       

    2. Click Settings in the upper‑right corner.

      File Manager - Settings
       

    3. Enable Show Hidden Files (dotfiles).

      Bluehost - cPanel - File Manager - Show Hidden Files
       

    4. Click Save. The page will reload and display all hidden files.
    5. Select your domain’s document root (example: public_html).
    6. Look for the .htaccess file inside the folder.

      .htaccess file
       

  4. Inside your .htaccess file, you’ll find PHP handler entries. You’ll need to determine and remove the old PHP handler.

    The outdated handler will look similar to one of these examples:

            
            # Use PHP81 as default
            AddHandler application/x-httpd-php81 .php
            <IfModule mod_suphp.c>
                suPHP_ConfigPath /opt/php71/lib
            </IfModule>

    or

            
            #Use PHPedge as default
            AddHandler application/x-httpd-php-edge .php
            <IfModule mod_suphp.c>
                suPHP_ConfigPath /opt/phpedge/lib
            </IfModule>

    If you cannot find these entries inside public_html, check other .htaccess files by clicking the Up One Level button.

    File Manager - Up One Level
     

    Below is the PHP handler you should keep. It includes the note "cPanel-generated handler, do not edit" and was created by MultiPHP Manager:

            
            # php -- BEGIN cPanel-generated handler, do not edit
            # Set the “ea-php81” package as the default “PHP” programming language.
            <IfModule mime_module>
              AddHandler application/x-httpd-ea-php81 .php .php81 .phtml
            </IfModule>
            # php -- END cPanel-generated handler, do not edit
                

    These conflicting PHP handlers cause the error. Removing the outdated handler allows the MultiPHP configuration to take effect.

  5. Create a backup of your .htaccess file before editing it.

    To back up your .htaccess file:

    1. Find the .htaccess file.

      .htaccess file
       

    2. Right-click and choose Copy.
    3. In the prompt, rename the copied file to /public_html/.htaccess.bak and click Copy File(s).

      public_html.bak file
       

    4. You’ll now see the backup file .htaccess.bak in the folder.
  6. Right‑click the .htaccess file and select Edit.

    Bluehost - cPanel - File Manager - .htaccess File - Edit
     

    You may also click the file once and use the Edit button at the top toolbar.

  7. A confirmation window will appear. Click Edit to proceed.

    Bluehost - cPanel - File Manager - .htaccess File - Edit Confirmation Prompt
     

  8. Make the required changes. To disable the unwanted PHP handler, place a # at the beginning of each line:
            
            #Use PHPedge as default
            #AddHandler application/x-httpd-php-edge .php
            #IfModule mod_suphp.c>
            #   suPHP_ConfigPath /opt/phpedge/lib
            #/IfModule>
            
    You may find multiple outdated PHP handlers. Comment out all of them. You should only keep one PHP handler block that begins and ends with:
            # php -- BEGIN cPanel-generated handler, do not edit
            
            # php -- END cPanel-generated handler, do not edit
            
  9. When finished, click Save Changes.

    Bluehost - cPanel - File Manager - .htaccess File - Save Changes
     

  10. Click Close to exit the editor.
  11. Reload your website to see if the error has been resolved.

Still, getting the "Missing MySQL Extension" error?

Your account may contain several .htaccess files. If the public_html .htaccess has already been updated and the error persists, you may need to review the .htaccess located in your root directory.

Follow these additional steps:

  1. Open the root directory by selecting the top-level folder on the left panel (/home#/user), where user is your cPanel username.

    File Manager - Root Directory - .htaccess file
     

  2. Look for another .htaccess file. Any .htaccess file containing random numbers or characters is disabled and can be ignored.
  3. Open the file and check for outdated PHP handlers. Follow the same instructions described above.
  4. Refresh your site after making the changes.

If the message still appears, access your cPanel MultiPHP Manager and select your website name. Then, set your PHP version to inherit from the dropdown menu.

MultiPHP Manager - Inherit
 

Frequently Asked Questions (FAQs)

What is the easiest way to check or update my website's PHP version?

You can manage PHP versions via cPanel’s MultiPHP Manager. For more details, read the What is the Latest Supported PHP Version? article.

Where can I find my File Manager?

All your website files are managed within the File Manager. Learn how to access your File Manager here: How to Access File Manager.

How can I edit my files inside the File Manager?

Your website files can be created, modified, or removed from your File Manager. Please visit the article, How to Create, Remove, and Edit Files in File Manager, for detailed instructions on managing your website files.

I am done with the steps above, but my site now shows a different error page (403, 404, or 405 Error). How to resolve it?

There are several possible causes why your website is showing an error. Troubleshooting depends on the error code (403, 404, 500, etc.) you are seeing. You can visit these helpful articles for more information on error page codes and how to resolve them.

Summary

This article explains how to fix the “Missing MySQL Extension” error in WordPress by identifying and removing outdated PHP handlers in your .htaccess file and ensuring your site uses the correct PHP version through MultiPHP Manager. It also covers what to do if multiple .htaccess files exist and provides troubleshooting steps if the issue persists or leads to new error pages.

If you need further assistance, feel free to contact us via Chat or Phone:

  • Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
  • Phone Support -
    • US: 888-401-4678
    • International: +1 801-765-9400

You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.

Loading...