Selecting default PHP version

amphora

Verified User
Joined
Feb 21, 2013
Messages
45
I'm offering 4 PHP versions on my server:

php1_release=7.0
php2_release=7.1
php3_release=7.2
php4_release=7.3

The way I have it now is that all news sites I add on the server will have PHP 7.0 as default. I would like to be 7.3 the default. The only way to do that is by setting php1_release to 7.3 but that means all sites that use 7.0 now will upgrade to 7.3, I don't want that.
Ideally custombuild would support an option like php_default=4 so all newly added domains will use the latest php version without changing all existing domains.
Is there a workaround available to do this?
 

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
581
Location
Murfreesboro
Might need more info.

Are you using CloudLinux or native OS? What OS are you using? Which selector are you referring to?

Have you actually tested and determined it wont work?

Don't the users select the PHP they want in PHP selector? So if they have 7.0 selected you are saying CB would change their selection to 7.3? I hope not.
 

amphora

Verified User
Joined
Feb 21, 2013
Messages
45
I'm using DA on CentOS 7. I'm not referring to any existing selector because it's not there. So maybe it's a feature request and should have posted it somewhere else?
I want to be able to set a default PHP version for new domains I add. Now it picks php1_release as default. I want it to be php4_release for example. Or when PHP 7.4 is out (and I replace php1_release=7.0 with php1_release=7.4) I want php1_release to be the default again.
 
Last edited:

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
581
Location
Murfreesboro
the php selector is already in the system

Screen Shot 2019-07-15 at 10.56.45.png


The user can choose whatever they need.

Screen Shot 2019-07-15 at 10.58.19.png


Might need to go in feature section.
 

amphora

Verified User
Joined
Feb 21, 2013
Messages
45
I want a system wide default selector. I don't want to manually need to change it everytime I add a new user
 

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
581
Location
Murfreesboro
I see what you are saying.

After some random testing of my own. It seems to be based on Position. Not good.

What the user selects needs to be maintained as long as it available no matter the position in the list.

example if we have this set

php1_release=7.0
php2_release=7.1
php3_release=7.2
php4_release=7.3

then the users have

user a 7.3
user b 7.2
user c 7.1
user d 7.0

then we go into options conf
and set

php1_release=7.3
php2_release=7.2
php3_release=7.1
php4_release=7.0

then the users have

user a 7.0
user b 7.1
user c 7.2
user d 7.3

not good..

Am I close...now?
 

amphora

Verified User
Joined
Feb 21, 2013
Messages
45
Exactly. Changing the phpN_release order every time a new version is released is far from ideal. But I do want new customers/users/domains to use the latest version when adding them. And with the current implementation that is only possible by changing php1_release value but that affects all current domains/users so unless I wanna change all users manually (or make a script which can be risky) I'm not going to do that.
Easiest way to avoid this, I think, is adding an option like php_default=4. And in DirectAdmin itself it would be nice that the PHP version selector is sorted by version number (latest on top) and not position.

So if I have something like this:

php1_release=7.1
php2_release=7.3
php3_release=7.0
php4_release=7.2
php_default=2

The select box would show

7.3 (default)
7.2
7.1
7.0

And when 7.4 is release I'll just replace php3_release=7.0 with php3_release=7.4 and set php_default=3
This way only users who are still using 7.0 (who probably shouldn't anymore) get affected and automatically upgraded.
 
Last edited:
Top