Multiple PHP version, and composer with Jailkit

Discussion in 'Installation/Configuration' started by BaptisteBru, Mar 30, 2018.

  1. BaptisteBru

    BaptisteBru New Member

  2. PhilV

    PhilV New Member

    Hello,
    First, bravo to Ispconfig developpers, really great job :)
    I also need to add support for multiple php version in jailkit chroot users.
    I've installed additionnaly to php 7.0, php 7.1 and 7.2.
    But I don't know how to allow user to use the one of their choice.
    Anyone can give us some help ?
    Thanks in advance
     
  3. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    I've added additional php versions user the ondrej repo, downloading and compiling them in /opt/php* may require changes.

    but in jk_init.ini, add:

    Code:
    [php]
    comment = The PHP Interpreter and Libraries
    executables = /usr/bin/php, /usr/bin/php7.4, /usr/bin/php7.3, /usr/bin/php7.2, /usr/bin/php5.6
    directories = /usr/lib/php, /usr/share/php, /usr/share/php, /etc/php, /usr/share/php-geshi,     /usr/share/zoneinfo
    includesections = env
    add php to your ispconfig -> system -> server config > <server> -> jailkit -> Jailkit chroot app sections
    update/create your ssh users jailkit.

    then to use a particular php version, they just specify it, eg /usr/bin/php7.3 somescriptfile.php
    or, if they want to stick with one php version, and just use the php command, create a .bashrc file in your jailkit ssh users home folder and add an alias entry to it: alias php='/usr/bin/php7.3'
    then logout and log back in, or run source ~/.bashrc
     

Share This Page