PHP versions

LawsHosting

Verified User
Joined
Sep 13, 2008
Messages
2,417
Location
London UK
Is there a way to choose the PHP version for NEW accounts and NEW domains?

php1 = 5.6 < need to remove actually
php2 = 7.2
php3 = 7.3

I'd like php2 for new accounts/domains..... Possible? Via pre/post script? Or?

Also, how do I get rid of PHP 5.6 then have php1 as 7.2 if I already have 7.2 and 7.3?
 
If you will be removing PHP 5.6 altogether, then I assume that you no longer need it for older domains, either, correct? If so, php1 is the default php version used by default when no other is specified.

So, you just need to change to this:

php1 = 7.2
php2 = 7.3
php3 = ?

You'll do this with CustomBuild (i'll leave php3 empty).

If you are using the CLI CustomBuild, use these commands:

Code:
cd /usr/local/directadmin/custombuild
./build set php3_release no
./build set php2_release 7.2
./build set php1_release 7.3
./build update
./build php n
./build rewrite_confs


If you have the php selector enabled in your DA configuration, which I assume you do, all users that had selected php1 previously should now be using php 7.3 instead of php 5.6.

Check with the following to see what domains will be affected:

Code:
grep -P 'php[\d]' /usr/local/directadmin/data/users/*/domains/*.conf
 
Last edited:
If you just change the php1/2/3 options I think it will change the actual php versions of many of the users, because in the domain .conf it seems it sets only the chosen CB php1/2/3 position and not the actual php version / value of those options.

Maybe its best to indeed change the options, but then right away carefully find & replace all user .confs to the new options so the actual php version doesn't change (except for those you want to go from 5.6 to 7.2). But that may be a bit of a puzzle.

If it indeed works like this, it could be useful if CB has a solution for this issue, because in reality there will be many cases like this, people need to shift to newer versions, older versions get dropped, while the newer versions were available for certain users already and they need to continue that version.
 
If it indeed works like this, it could be useful if CB has a solution for this issue, because in reality there will be many cases like this, people need to shift to newer versions, older versions get dropped, while the newer versions were available for certain users already and they need to continue that version.

I second this, as I think to understand the selector only points to the php5 or php7 which has already been build.
Since the speed of php being developed is quit high, moving around users to different php versions without having to ./build php (downtime) each time for 3 or even 4 versions would be a great option!

Ray
 
Back
Top