Additional php version "in sync" for shell users

Discussion in 'Installation/Configuration' started by atnetws, Apr 15, 2019.

  1. atnetws

    atnetws New Member

    Hi folks,
    is there any chance to keep a web site's php version in sync with the version that shell users get when simply fireing a "php" command?
    On every server, shell users use the OS's default php version. So for example, if a composer based project requires php7.2, a cli execution uses php7.0, which may cause composer to reject any command as this version is too low.
    Could ispConfig write an alias definition in .bashrc?

    Cheers,
    Marcus
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    You can include multiple php versions inside a jail, so you would have a functioning /usr/bin/php7.0 and /usr/bin/php7.2 binary, and as long as you called them by the full version path you'd be fine. One place you could run into an issue is when the system /usr/bin/php (which is a symlink to /etc/alternatives/php) is version 7.0, then you change the /etc/alternatives/php symlink in your jail to point to 7.2, you will loose your change again once you update your jail (eg. following php package updates). You of course would simply have to redo your symlink(s) again, so not a huge problem, and it could be automated. And that of course is also assuming you do update your jails following package updates of the underlying system packages (which you really should, but is currently not automated for you .. though it will be in an upcoming ispconfig version).

    Along the lines of feature request/wishlists, it would be nicer to have a little interface in ISPConfig to select what php version got installed into a jail (probably just make the cli version the same as the website's php version). I don't see a feature request in the issue tracker for that offhand, but might be worth creating one. (Similarly, a setting to add perl or node.js to a specific jail would be nice, all requiring a separation of global jailkit defaults with per-website settings (and wrapping a checkbox for php, perl, etc. per jail would really make it simple)).
     

Share This Page