Results 1 to 4 of 4

Thread: PHP versions

  1. #1
    Join Date
    Sep 2008
    Location
    London UK
    Posts
    1,747

    PHP versions

    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?
    Regards, Peter
    UK Web Hosting - Professional & Reliable Shared and VPS Hosting! Offering DirectAdmin licences on our VPS's
    Free Web Tools

  2. #2
    Join Date
    Jul 2019
    Posts
    25
    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 by scriptkitty; 10-18-2019 at 08:30 AM.

  3. #3
    Join Date
    May 2008
    Location
    The Netherlands
    Posts
    1,198
    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.
    ~ Arieh

  4. #4
    Join Date
    May 2016
    Posts
    3
    Quote Originally Posted by Arieh View Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •