additional PHP Version for Jailkit user (SLOVED)

Discussion in 'Installation/Configuration' started by degoya, Nov 11, 2024 at 6:34 PM.

  1. degoya

    degoya New Member

    How i can use the additional PHP Version for a jailkit user?

    i've compiled and installed php 8.3.13 and setup as php-fpm for Nginx with those settings based on a howto:
    Path to the PHP-FPM init script: php-8.3.13-fpm
    Path to the php.ini directory: /opt/php-8.3.13/lib
    Path to the PHP-FPM pool directory: /opt/php-8.3.13/etc/php-fpm.d

    That works fine so far. But when i create a JailKit SSH User i only get the system PHP Version when i connect and do a php -v in the cli.
    What i need to do to setup the same php version for the jailkit user?

    i've tried to add this to the jk_init.ini
    Code:
    [php8_3_13]
    comment = php version 8.3.13
    paths = /opt/php-8.3.13/bin/php, /opt/php-8.3.13/bin/php-cgi, /opt/php-8.3.13/lib, /opt/php-8.3.13/etc
    includesections = php_common
    
    but when i try
    Code:
    jk_init -v -j /var/www/clients/client4/web39 php8_3_13
    i get a error because he can't create the folder opt in the web39 folder.

    How i need to set everything up that i can use additional php from the website in the cli of the according shell user?
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    On ISPConfig 3 system installed with ISPConfig autoinstaller, the /etc/jailkit/jk_init.ini already contains sections for all installed PHP version (and the autoinstaller installs all of them that are available from the Ondrej Sury repository). Perhaps the PHP you compiled is not set up properly?
    You do not mention what OS and what version you are running, so it is hard to help you more.
     
  3. degoya

    degoya New Member

    ahh i've forgot to say that i'm on debian bullseye and used the perfect multi server setup tutorial to setup the server. i've setup the additional PHP like shown in a tutorial on howtoforge. The PHP works when i use it in the websites but i'm not able to get it running with jailkit.

    Is there a ways to set it up manually and the correct way? any tutorial on this?
    why isn't a ssh user for a site using the same php like the site uses?
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    ahrasis likes this.
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    You add them in ISPConfig under System > Server config in the jailkit settings. No need to manually add them using jk_init. You can access the additional PHP versions by using their path like /usr/bin/php8.3 in the website.
    You seem to have used an outdated tutorial then as additional PHP versions are not installed in /opt anymore for many years. ISPConfig now uses the packages from sury, which get installed by the auto-installer automatically. So no need to manually install any additional PHP versions and if you disabled additional PHP versions in the auto-installer, then follow this guide to install them:

    https://www.howtoforge.com/ispconfig-php-debian/
     
    Last edited: Nov 12, 2024 at 8:48 AM
  6. degoya

    degoya New Member

    thanks for all the help and pointing me in the right direction. then i'm going to install the packages from Sury and follow the Tutorial Till has posted.
     
  7. degoya

    degoya New Member

    Everything works great now after installing the PHP from Sury, thanks again for your Support.
    I've installed the needed PHP Version with
    Code:
    https://www.howtoforge.com/ispconfig-php-debian/
    then i added the php8_3 to the Jailkit Configs:
    Code:
    ispconfig -> system -> server config > <server> -> jailkit -> Jailkit chroot app sections
    after updating the ssh users jailkit and adding the following to the .bashrc to switch to the wanted php version
    Code:
    alias php='/usr/bin/php8.3'
     

Share This Page