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.
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.
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.
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.
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 Librariesexecutables = /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.6directories = /usr/lib/php, /usr/share/php, /usr/share/php, /etc/php, /usr/share/php-geshi, /usr/share/zoneinfoincludesections = env, php_common, php7_4
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.