jailkit - php errors ... ubuntu 18.04.6

Discussion in 'General' started by trondhuso, Jan 6, 2022.

  1. trondhuso

    trondhuso Member

    I am running a few PHP-scripts in CLI and I can see that something isn't right. I have tried to make things work, but without much luck - yet.

    I am seeing this in the logs:
    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/curl.so' - /usr/lib/php/20160303/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/imagick.so' - /usr/lib/php/20160303/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/ldap.so' - /usr/lib/php/20160303/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/soap.so' - /usr/lib/php/20160303/soap.so: cannot open shared object file: No such file or directory in Unknown on line 0
    And this:
    ftp_connect(): php_network_getaddresses: getaddrinfo failed
    My gut feeling says something is wrong with the jail, but I am not sure anymore.
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Yes, files are missing. Changes to the base system get propagated eventually, do these exist there? If not, you need to install some additional packages for those modules.
     
  3. trondhuso

    trondhuso Member

    Good question. One thing that I do see is that as root I get php 7.4. as web1 I am getting php7.1 I'd like to have 7.4 in the jail as well. So, I'll figure out how to set the version.
     
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    To save a few minutes searching, there is no generally supported way to have /usr/bin/php point to different php versions inside jails, though it's easy to add multiple php versions to a jail, then you call /usr/bin/php7.4 or whatever as the interpretter.
     
  5. trondhuso

    trondhuso Member

    Right now the php section in jk_init looks like this (and my gut feeling tells me it could be wrong)

    PHP:
    #comment = default php version and libraries
    #paths = /usr/bin/php
    #includesections = php_common, php5_6, php7_4,
    comment The PHP Interpreter and Libraries
    executables 
    = /usr/bin/php, /usr/bin/php7.4, /usr/bin/php7.3, /usr/bin/php7.2, /usr/bin/php7.0, /usr/bin/php7.1, /usr/bin/php5.6
    directories 
    = /usr/lib/php, /usr/share/php, /usr/share/php, /etc/php, /usr/share/php-geshi, /usr/share/zoneinfo
    includesections 
    envphp_commonphp7_4
     
  6. trondhuso

    trondhuso Member

    So,
    I have finally made it work. The issue on my end was that php_alternatives was linked to the wrong php-version. php_alternatives is /usr/bin/php is a symlink to (which again is a symlink to the correct/choosen php-version).
    So I deleted the symlink and created a new one linking to php7.4 I then also installed a few more missing libraries and my error messages are gone.

    That is not to say that the problem is fixed in the correct way. Any suggestions on how to do this more correct are welcome.
     

Share This Page