How to fix the “Your PHP installation appears to be missing the MySQL extension which is required by WordPress” Error on HostGator

My blog displayed on my tablet

This is an off-topic post, but many photographers use WordPress as the basis of their photography portfolios and photo blogs, so I am writing it anyway.

If you’re using HostGator and you tried to update your PHP version to the most recent one (like I did) and you thereby broke your entire WordPress blog (like I did), here’s a quick fix I found that will hopefully get everything working for you again.

Even though this is specifically for those of us using HostGator, it may work with other hosting platforms that use cPanel. Or you may be able to extrapolate a solution that works for you based on this information if you’re using different control panel software or a Linux distribution on your own server. Give it a shot if nothing else is working – but remember, you are doing this at your own risk and I am not responsible if you mess up your site even more.

The Error

You probably originally got this error:

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

And if you’re like me you tried a bunch of things to fix it, including deleting the .htaccess file, and have made things much, much worse. You have likely now ended up with this error:

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

Deprecated: Directive 'allow_url_include' is deprecated

You are now unable to get into your blog at all. Even the WordPress dashboard won’t work.

The Solution

Log into cPanel in your hosting account. Inside cPanel, find MultiPHP Manager.

MultiPHP sounds like a multivitamin.

On the MultiPHP Manager page, find the drop-down menu that lets you select PHP versions. Instead of choosing a version number, select inherit. Be sure the domain that holds your WordPress blog is selected with a checkmark. In my case, I have a bunch of domains so I checked them all. Then press the Apply button.

Make sure the checkboxes are checked.

Check your site now by logging in to the WordPress admin panel. It should be working again.

If you previously deleted the .htaccess file and the Permalinks are no longer working (you will get 404 errors when you click on links to your blog posts), then go into your WordPress dashboard and find the Settings > Permalinks section. Don’t change anything there, but press the Save Changes button anyway. That will regenerate all of your Permalinks because WordPress will rewrite your .htaccess file after you press it.

If this solution worked for you, let me know below. Or if you solved it another (or better) way, please leave it in the comments below so other people with this problem can be helped. And as always, follow me on Instagram.

Leave a Reply

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