How to fix: PHP installation appears to be missing the "MySQL Extension"
![]() |
How to fix: PHP installation appears to be missing the "MySQL Extension" |
Did you update your PHP and get an odd error? Have no fear, for Josh is here. We'll teach you how to fix this annoying error and get your website up and running in no time.
In this blog you'll learn:
- How to spot the "MySQL Extension" Error after updating your PHP
- How to locate your .htaccess file
- How to backup your .htaccess file
- How to comment or delete what is causing the error
- How to be super excited about fixing your site
How to spot the "MySQL Extension" Error after updating your PHP
Fix an issue when you changed your PHP version with MultiPHP Manager. In this example, I recently changed my PHP version to 7.3. It's exactly what my site needs, but I'm having a really interesting and strange issue on my site.
How to fix it. Today I will teach you. The first thing I want to show you how to do, is we've got our PHP info page that's already created. I can see that I'm on 7.3. That perfect.
The only bad part is when I actually go to my site, it's got an error here. It's got some content warnings and also says that my PHP installation is missing the MySQL extension. Today I'm going to show you how to resolve this issue really quickly. The first thing I want to do is go to my file manager for the document root for this site. I'm working on-muczalatv.com.
Since that's my primary domain, that's always going to be in the mypublic_html folder, so we'll jump here into file manager and I'm just going to scroll down to find that folder. Here it is. We'll double-click to get inside of it.
How to locate your .htaccess file
The file I'm looking for today is my .htaccess file. This is a really important file to Apache, which is the webserver because it gives us a lot of different directives on what PHP version we should use, and a whole bunch of different rules and rewrites. Pretty much everything that the web server uses, so I want to go look inside this file to see if there's anything that I could make a change to. I'll right-click and I'll do view, just to get a look at it first.
Down here you will see, at the very bottom the new PHP handler that was put in by MultiPHP Manager. You can note it because it says, "Begin cPanelcPanel generated handler here do not edit". Right above it is actually my old PHP handler.
That was from the PHP selector, which is an older version of a program inside of cPanel that allows us to change or manipulate our PHP version. These two are actually conflicting, so what I need to do is go through and either remove or edit out the older one so that the new one can fully take effect. Now that I've got an idea of what I need to do, I'll you how to do it. I'll click the right X out of here to exit the view.
How to backup your .htaccess file
I'll want to take a full backup of this file before I make any changes. It's super important, so I can always roll back. Even though the site is broken, it'll be good to know where I start. I'm gonna do a copy, and then all I need to do is give it the full path to the file. I'll do .htaccess and I'll just do '.bak' for backup. Copy over that file. I've got that file right here so in case I need to roll back I've always got that option.
I'm going to go right-click and edit the initial .htaccess file. As we noted earlier, we've got our old handler here and our new handler all the way at the bottom. What I'm gonna do is essentially disable this add handler right here. I can do one of two things.
How to comment or delete what is causing the error
How to be super excited about fixing your site