composer - phar extension is missing - jailkit

Discussion in 'General' started by trondhuso, Sep 22, 2023.

  1. trondhuso

    trondhuso Member

    I have installed composer on the system, but in the jail it is not working. Even after telling that composer shall be included

    When running composer in the jail as the user, I am seeing the message below:
    PHP's phar extension is missing. Composer requires it to run. Enable the extension or recompile php without --disable-phar then try again.

    jk_init:
    [composer]
    comment = composer
    paths = composer, /usr/local/bin/composer, /usr/share/doc/composer, /usr/bin/composer
    includesections = php, uidbasics, netbasics

    PHP:
    comment = default php version and libraries
    paths 
    = /usr/bin/php
    includesections 
    php_commonphp7_3

    [php_common]
    comment common php directories and libraries
    # notice:  potential information leak
    #  do not add all of /etc/php/ or any of the fpm directories
    #  or the php config (which includes custom php snippets) from *all*
    #  sites which use fpm will be copied to *every* jailkit
    paths = /usr/bin/php, /usr/lib/php/, /usr/share/php/, /usr/share/zoneinfo/
    includesections envlogbasicsnetbasicsextendedshell


    [php8_0]
    comment php version 8.0
    paths 
    = /usr/bin/php8.0, /usr/lib/php/8.0/, /usr/lib/php/20200930/, /usr/share/php/8.0/, /etc/php/8.0/cli/, /etc/php/8.0/mods-available/
    includesections php_common

    [php8_1]
    comment php version 8.1
    paths 
    = /usr/bin/php8.1, /usr/lib/php/8.1/, /usr/lib/php/20210902/, /usr/share/php/8.1/, /etc/php/8.1/cli/, /etc/php/8.1/mods-available/
    includesections php_common

    [php8_2]
    comment php version 8.2
    paths 
    = /usr/bin/php8.2, /usr/lib/php/8.2/, /usr/lib/php/20210902/, /usr/share/php/8.2/, /etc/php/8.2/cli/, /etc/php/8.2/mods-available/
    includesections php_common
     
    Mateus Magen likes this.
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  3. trondhuso

    trondhuso Member

    hi taleman, Thanks for the pointer.

    The solution the poster had was to include mods-available:
    Example for php8_2 (out of the box) shows mods-available is already included in paths. They are included by default for all PHP versions...

    So - odd... Same goes for other mods-available....

    [php8_2]
    comment = php version 8.2
    paths = /usr/bin/php8.2, /usr/lib/php/8.2/, /usr/lib/php/20210902/, /usr/share/php/8.2/, /etc/php/8.2/cli/, /etc/php/8.2/mods-available/
    includesections = php_common
     

Share This Page