Add application to User Jail

Discussion in 'Installation/Configuration' started by cjsdfw, Oct 9, 2021.

  1. cjsdfw

    cjsdfw Member

    Hi guys,
    I am trying to add the Wordpress CLI (wp-cli.phar) to an existing user in a given website but I am running into an issue and don't know enough to resolve.
    I know this question has been answered before, I reviewed this related post, but I am getting an error when I follow suggested procedure:
    Add more applications to shell user Jailkit chroot
    This is what I have done and the error I am getting:
    1) I downloaded the wp-cli.phar into my /opt directory and moved it to the /usr/bin directory after renaming it:
    2) I edited the /etc/jailkit/jk_init.ini (for future jails) and modified the [wp] section as follows:
    Code:
    [wp]
    comment = WordPress Command Line
    executables = /usr/bin/wp
    includesections = php, mysql-client
    
    3) I ran the Jail Copy command to enable the jail for the existing user
    4) I ssh with user credentials into the website and check if wp is available:
    wp is listed in the /usr/bin directory of the user:
    Executing wp yields an error:
    5) If I sudo onto root and move to the /usr/bin directory of the user in question /var/www/clients/client2/web15/usr/bin/ and esecute wp it works:
    Seems like a permissions issue but really don't know enough. Any advise?
    Thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The phar exzension is missing in the php in the jail.
     
  3. cjsdfw

    cjsdfw Member

    Hi Till and thanks for quick response.
    Not sure how to add extension to Jail, if I ran info.php in the website Phar extension is enabled:
    Can you point me in the right direction to add Phar to Jail?
    Thanks
     
  4. cjsdfw

    cjsdfw Member

    I think my issue may be related to the location of the additional php version added to the server which was installed in /opt/php-7.4/ and the jk_init.ini file [php7_4] points to a different location:
    Not sure if I need to reinstall php 7.4 or adjust the jail section? I tend to think I should adjust the jail section, any suggestions?
     
  5. cjsdfw

    cjsdfw Member

    OK, I was able to add the mods_available directory to the php section of the jk_init.ini file and that fix the problem. The mods_available directory includes the PHAR extension.

    Thanks for the pointer Till!
     

Share This Page