Results 1 to 7 of 7

Thread: Selecting default PHP version

  1. #1
    Join Date
    Feb 2013
    Posts
    45

    Selecting default PHP version

    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?

  2. #2
    Join Date
    Jul 2017
    Location
    Murfreesboro
    Posts
    353
    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.
    Thanks,
    Brent Dacus
    Just a regular guy from Tennessee

    CentOS 7 | DA | CB 2.0 | MariaDB 10.4 | PHP 7.2

    help me...it's HERE or Type "your issue your os directadmin" in google


  3. #3
    Join Date
    Feb 2013
    Posts
    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 by amphora; 07-15-2019 at 08:58 AM.

  4. #4
    Join Date
    Jul 2017
    Location
    Murfreesboro
    Posts
    353
    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.
    Thanks,
    Brent Dacus
    Just a regular guy from Tennessee

    CentOS 7 | DA | CB 2.0 | MariaDB 10.4 | PHP 7.2

    help me...it's HERE or Type "your issue your os directadmin" in google


  5. #5
    Join Date
    Feb 2013
    Posts
    45
    I want a system wide default selector. I don't want to manually need to change it everytime I add a new user

  6. #6
    Join Date
    Jul 2017
    Location
    Murfreesboro
    Posts
    353
    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?
    Thanks,
    Brent Dacus
    Just a regular guy from Tennessee

    CentOS 7 | DA | CB 2.0 | MariaDB 10.4 | PHP 7.2

    help me...it's HERE or Type "your issue your os directadmin" in google


  7. #7
    Join Date
    Feb 2013
    Posts
    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 by amphora; 07-16-2019 at 03:07 AM.

Posting Permissions

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