Quick change of PHP version without losing settings

galbaras

Member
Mar 26, 2013
19
2
53
cPanel Access Level
Root Administrator
Hello cPanel experts,

Whenever a new PHP version becomes stable and I want to change a whole range of accounts to using it, I need to reconfigure my choice of extensions and options, and that's just not my idea of fun.

Is there a way to change the PHP version while retaining extensions and options?

Can extensions and options be configured elsewhere to override those set on the "Select PHP Version" page?

If not, how can this be turned into a feature request?

Cheers,
Gal
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,226
463
Hello @galbaras,

If I understand correctly, you'd like an option to account for a scenario like this:

1. You decide to enable the bz2 PHP extension, so you browse to "WHM Home » Software » EasyApache 4 » PHP Extensions" and enable the following package:

php55-php-bz2

2. Later, you decide to switch the accounts to PHP 5.6, and notice the php56-php-bz2 package isn't automatically enabled and thus you have to manually enable it.

If this is correct, I recommend opening a feature request for the ability to compare the extensions of each PHP version and provide a method to easily enable all missing extensions from one version to another.

Otherwise, you may find the the ability to create EA4 profiles in cPanel 64 allows you to more easily manage the build profiles:

EasyApache 4 - Create a Profile - EasyApache 4 - cPanel Documentation

Thank you.
 

galbaras

Member
Mar 26, 2013
19
2
53
cPanel Access Level
Root Administrator
No, my scenario is very different.

I go into cPanel->Select PHP Version, check some boxes for extensions, then change some option and save. Later on, I switch from PHP 7.0 to 7.1 and everything goes back to default :(

Although different PHP versions may have different extensions and options, keeping my settings for the ones that are the same seems like better user interface than resetting all of them. With many websites to handle and many settings to change, this quickly amounts to a lot of work, which can be (easily) saved.
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
158
168
New Jersey
cPanel Access Level
DataCenter Provider
You are referring to CloudLinux's PHP selector.

Go to WHM > CloudLinux LVE Manager > Selector

Then there is a drop down called: "Choose default modules for"

Select each version of PHP and setup your default PHP extensions, do this for each version.

Now anytime you change the PHP version in "Select PHP Version", these default extensions will be selected, if for some reason they are not, click the "Default" button at the bottom and it will auto fill them.

Hope this helps!
 

galbaras

Member
Mar 26, 2013
19
2
53
cPanel Access Level
Root Administrator
Sorry, I didn't state that I was on a shared server, where I don't have access to the system-wide settings for PHP.

Still, I'm on a reseller package and need to modify many accounts. Can this function be delegated to me?

Either way, resetting everything when the PHP version changes doesn't seem right.
 

SysSachin

Well-Known Member
Aug 23, 2015
604
48
28
India
cPanel Access Level
Root Administrator
Twitter
Hello,
If you have not root access then you need to contact to your hosting provider as they will change setting server wide.
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
158
168
New Jersey
cPanel Access Level
DataCenter Provider
Unfortunately, nothing you can do, you can ask your web host but I doubt they will use the defaults YOU want as this would affect all users.

Your best bet is to upgrade to a server where you have root access so you can set the defaults yourself, otherwise do a feature request:

New Feature Request | cPanel Feature Requests
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,226
463