Hey everyone, it’s Josh here with HostGator. Today I want to show you how to check what version of PHP you’re using on your site and how to change it through cPanel’s MultiPHP Manager. Let’s get started.
Before we do anything, the first thing I want to show you how to do is to create a phpinfo.php page. Now I’m gonna be working on my primary domain today, which is b-radpitt.com, and that’s gonna be stored inside of my Public_HTML directory.
We’ll scroll down until we find the file manager, we’ll click on that icon, and it’s gonna take me to my cPanel’s home directory. If I’m working inside of public_html, I need to scroll down and find that folder.
We’ll double click here. This is where all the content from my website is stored, and I need to create a brand new file. I’m going to click the top left-hand corner where it shows a plus sign next to the file.
Update PHP Version In HostGator
Click that, and now we need to give this new file a name. The standard naming convention for a phpinfo page is ‘phpinfo.php,’ but you can really name this file anything that you want as long as it has the ‘.php‘ extension at the end.
Once I’ve got it typed in, we’ll click the ‘create a new file‘ button here, and now it has officially appeared inside of my file manager in the correct directory. It’s essentially an empty file at this point, so now we need to put some content in it so I can actually view the version of PHP that I’m using.
We’ve got a beneficial knowledgebase article here, and I’ll link this inside the video. What we’re gonna do is take the content inside of the show all PHP information box, copy that to my clipboard, and then head back over to the file manager.
How to Connect FTP Using FileZilla Software
We need to edit this file to put some of that data inside it, so I’ll right-click on the PHP info page and click the edit button. That’s always going to give you an option to back up the original file.
Changing PHP Version Settings
Since there’s currently no content in here, we’re not gonna need to do that. I’ll go ahead and click edit, and we are inside of the blank file. I’m going to paste that information from the phpinfo knowledgebase article, and then I’m gonna click ‘Save Changes‘.
I just got a nice success bar down here, showing me that it’s updated, and we can essentially close out of this now. Now that I’ve got my phpinfo page actually created, what I need to do is go and view it in a real browser.
I’ll head over to my site, and all we’ll need to do is put / and then the name of the file then hit enter. And voila, I have a phpinfo page. I can now see that I’m using version 7.1.33, and all of the modules and everything that’s loaded inside of that PHP version is listed down here.
Today we’re really just gonna focus on the actual PHP version. Let’s say I want to update this to something newer like 7.2 or perhaps the newer 7.3. I’m gonna head back to my cPanel now, and what I want to do is go to the quick functions bar.
I’ll type in ‘multi.’ It’s gonna bring me to MultiPHP Manager. As you can see, this is also in the software section, so if you wanted to scroll down and find it, you can. I like that quick search function, so we’ll click on the MultiPHP Manager here, and this page is gonna allow me to modify the version of PHP for any domain that I have on my server.
PHP Version Permissions List:
Let’s scroll down just a little bit here, and I can see all the domains. Since I’m working on my b-radpitt.com domain, I’m gonna select the checkbox next to that domain. Up here, you’ll see that the apply button has illuminated, and now we can go ahead and choose the exact version of PHP that I want to use.
I’m currently using 7.1. I want to go all the way up to 7.3, so choose that from the drop-down, and we’ll click apply. I got a nice successful message there at the top. Let’s head back to our phpinfo page and refresh this to see if the change is taking effect.
How to Reset a WordPress Password from phpMyAdmin
There we have it; I am now on Version 7.3. It really is that easy to change the version of PHP that you’re using. If you’re on WordPress or a different CMS that needs to be in the more updated version, it’s straightforward to get that done.
Update OLD PHP Version
If you’re using one of the older versions of PHP selector, there may be one of the older handlers(what tells the website which PHP version to use) that’s inside of your .htaccess file. I’ll show you how to track that down just if you’re receiving any error messages on your site.
Let’s get back to our cPanel’s file manager, and I’ll take a look at this .htaccess file. I’m gonna right-click that just a view, and down here at the bottom; you’ll see the new PHP Handler.
If you have an earlier version of PHP or an earlier handler, it will usually be above this. If you notice any issues on your site, you can use the comments to comment on the actual .htaccess file or remove it by editing that file. As you can see, now we are officially on version 7.3. I’ve completely updated my PHP version, and it’s really just that simple.