(FIXED) WP CLI on Jailkit (Debian 9): Class 'Phar' not found in /usr/bin/wp

Discussion in 'Installation/Configuration' started by DARK9Y8, Jun 25, 2019.

  1. DARK9Y8

    DARK9Y8 Member HowtoForge Supporter

    Hi
    I followed this guide: https://kk6jyt.com/wp-cli-jailed-users-ispconfig-3-debian-jessie/
    Its not working for debian 9 which has php 7.0

    Here is my
    Code:
    [wp]
    comment = WordPress Command Line
    executables = /usr/bin/wp
    includesections = php
    
    [mysql]
    comment = MySQL Client
    executables = /usr/bin/mysql
    
    [php]
    comment = The PHP Interpreter and Libraries
    executables = /usr/bin/php7.0, /usr/bin/php
    directories = /usr/lib/php, /usr/lib/php/7.0, /etc/php7.0, /usr/share/php, /usr/share/zoneinfo, /usr/share/php7.0-zip, /usr/share/php7.0-curl, /usr/$
    includesections = env
    
    [env]
    comment = Environment Variables
    executables = /usr/bin/env
    
    
    When I ssh to the jailed user and use the command
    , then it gives following error:

    Code:
    Fatal error: Uncaught Error: Class 'Phar' not found in /usr/bin/wp:3
    Stack trace:
    #0 {main}
      thrown in /usr/bin/wp on line 3
    When I run this command under jailed shell
    , it gives nothing but when I run under root user, it works good.

    Code:
    /etc/php/7.0/cli/conf.d/20-phar.ini,
    Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, compress.bzip2, phar, zip
    Phar-based phar archives => enabled
    Tar-based phar archives => enabled
    ZIP-based phar archives => enabled
    phar.cache_list => no value => no value
    phar.readonly => On => On
    phar.require_hash => On => On
    How can I make it work for jailed users?

    Thanks
     
    Last edited: Jun 25, 2019
  2. DARK9Y8

    DARK9Y8 Member HowtoForge Supporter

    Update: I fixed it. Here is what I changed in
    Code:
    [wp]
    comment = WordPress Command Line
    executables = /usr/bin/wp
    includesections = php
    
    [php]
    comment = the php interpreter and libraries
    executables = /usr/bin/php,/usr/bin/php5.6,/usr/bin/php7.0,/usr/bin/php7.1
    directories = /usr/lib/php, /usr/share/php, /usr/share/php5, /etc/php, /usr/share/php-geshi, /usr/share/zoneinfo, /etc/snmp, /usr/share/snmp
    includesections = env
    
    [env]
    comment = environment variables
    executables = /usr/bin/env
    
    [mysql-client]
    comment = mysql client
    executables = /usr/bin/mysql, /usr/bin/mysqldump
    paths = /usr/lib/libmysqlclient.so
    
    [composer]
    comment = composer
    executables = /usr/local/bin/composer
    includesections = php, uidbasics, netbasics
    I have added support for Composer too, Thanks for this gist: https://gist.github.com/broros/29d348c7737e42edb07f64faee2113a1
     
    ahrasis and till like this.

Share This Page