user3304303
user3304303

Reputation: 1043

Is there a way to lock the PHP version in CPanel so it doesnt ever revert back?

I'm using hostgator shared server and using CPanel. I have multiple sites and only one of them needs PHP version 5.5 (because it uses the password_verify() function). The rest need to be on version 5.4, or they break.

I can go into PHP Configuration and choose the specific folder in public_html that houses the site files for the site that needs to be on 5.5 (we'll call it site55.com) and change the PHP setting from "System Default" to "5.5".

This works fine...UNTIL it reverts back to 5.4 at some point randomly in the future. Sometimes it happens a day later, sometimes it happens 3 weeks later, but it always happens eventually.

I am about to go live with this site that will get a large amount of traffic so I'm terrified this is going to happen when it's live (i.e. it reverts back to 5.4 and the site breaks and I am unaware).

My main question is: Does anyone know if there is a way to ensure a PHP version that gets set via PHP Configuration in CPanel STAYS?

I tried asking hostgator support and they were of no help. He kept saying you can only have one setting for ALL the sites (either 5.4 or 5.5) but that's not been the case. If my other site (site54.com) is on 5.5, it breaks. Right now, site55.com is on 5.5 and working fine, while site54.com is on 5.4 and working fine. So he is dead wrong and I am seriously thinking about changing hosts now.

Anyway, if anyone has any ideas regarding this, I'd be very grateful.

Thanks!

Upvotes: 0

Views: 243

Answers (1)

Maverick
Maverick

Reputation: 945

Try to edit the .htaccess as written here for php 5.4 and change it as below:

# Use PHP 5.5
AddHandler application/x-httpd-php55 .php

Upvotes: 1

Related Questions