So it was time to update my PHP. I’ve been putting it off for a while now, but the warning in my WordPress dashboard won’t go away and I can only bury my head in the sand for so long.
I head over to WordPress support for a bit of guidance which gives all the reasons to update my PHP. Makes sense I thought….but what’s this?? ……it says
“don’t be afraid!”
I’m not. How hard can it be?
“Updating your PHP version should not be a problem”
Good. It’s only the click of a button
“but we can’t guarantee that it’s not”
OK now i am afraid
I think we all know where this is going don’t we?
I logged in to my HostGator cPanel and before starting backed up my site.
Via the MultiPHP Manager I selected the most up to date PHP version and hit apply. It said it had successfully applied the PHP version…Job done!…. piece of cake. Went to view my site and……………..
Oh dear what’s this?
Site crashed and no idea what to do! Tried reverting back to old PHP version but it wouldn’t let me. Next came my usual frantic clicking of buttons in cPanel when something like this happens (no idea why I do this). Gave up and restored my backup.
Did a bit of digging around and found it was highly likely a conflict in my .htaccess file causing the problem. Here’s what I did.
In my HostGator cPanel I opened the File Manager, selected the public_html folder, as this is where my primary domain has been installed from the beginning, and then right clicked on the .htaccess file to view the PHP information.
The above PHP handler was correct and there was nothing in this file causing a conflict. However I noticed I had another .htaccess file in my home directory.
When I viewed this file I found another PHP handler.
This is what I was looking for. Although I was led to believe this should have been in my public_html .htaccess file. That aside I cancelled out this handler by right clicking on the file, selecting edit, put a hash tag at the beginning of each line of code and then saved the changes. Before doing this I made a copy of this file…just in case.
Doing this turns the code green which means this PHP handler should now be ignored. I could have deleted it but I prefer this method.
So that was it. My site was back up and running……crisis over.
Don’t forget the above fix is in reference to a HostGator WordPress install. But when looking for the answer I found this problem not to be unique to HostGator.
If you are reading this post before attempting a PHP upgrade, as always before starting, back up your site….you might be very glad you did.