You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to load dynamic library 'imagick' and 'zip' in Bookworm based php8.2 and php8.1 images #833
The command "php -v" inside the current container with the TAG '6.2.2-php8.2-apache' show me, that the library imagick and zip is broken. This is since the Image based on Bookworm. The Image with the same TAG based on Bullseye has no issue.
The Hash from the latest Container is: sha256:95d9d66652be2ded944716537bcdc223d1f600444a34d0a970d6150d0d7ef9ea
Output:
root@3da134196095:/var/www/html# php -v
[15-Jun-2023 07:32:08 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/imagick (/usr/local/lib/php/extensions/no-debug-non-zts-20220829/imagick: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20220829/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory)) in Unknown on line 0
[15-Jun-2023 07:32:08 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/zip.so (libzip.so.4: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20220829/zip.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20220829/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.2.7 (cli) (built: Jun 14 2023 05:12:47) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies
I have similar issues when running my ci cd workflow in gitlab. Everything works on local machine though.
[15-Jun-2023 14:06:09 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory)) in Unknown on line 0
[15-Jun-2023 14:06:09 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/zip.so (libzip.so.4: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/zip.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 60 installs, 0 updates, 0 removals
@AntonLindell Is it possible, you have on the one hand an old Image and on the other a new one? The Tag from the image is still the same, but since Yesterday the Image based on Bookworm. Older images are based on Bullseye.
In my case the Issues are in the Bookworm Images. If I take the old Bullseye image image with the same TAG everything is fine.
I'd suggest updating docker and libseccomp on the host. Newer base OS's use newer system calls and an older libseccomp can block them since they are unknown to it. You can verify that it is libseccomp by running the bookworm image with --security-opt seccomp=unconfined.
@AntonLindell Is it possible, you have on the one hand an old Image and on the other a new one? The Tag from the image is still the same, but since Yesterday the Image based on Bookworm. Older images are based on Bullseye. In my case the Issues are in the Bookworm Images. If I take the old Bullseye image image with the same TAG everything is fine.
You saved the day! Adding bullseye like:
FROM php:8.1-apache-bullseye
in the Dockerfile from this repo made my Gitlab job succeed, finally.
I'd suggest updating docker and libseccomp on the host. Newer base OS's use newer system calls and an older libseccomp can block them since they are unknown to it. You can verify that it is libseccomp by running the bookworm image with --security-opt seccomp=unconfined.
I try it again with the lates Image from today on an fresh installed Debian Bookworm and with the latest Docker from https://download.docker.com/linux/debian bookworm stable and no Issue.
With the same Setup and with the latest Image with the TAG wordpress:6.2.2-php8.2-apache I have warnings from PHP:
[16-Jun-2023 07:33:04 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/imagick (/usr/local/lib/php/extensions/no-debug-non-zts-20220829/imagick: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20220829/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory)) in Unknown on line 0
[16-Jun-2023 07:33:04 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/zip.so (libzip.so.4: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20220829/zip.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20220829/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.2.7 (cli) (built: Jun 14 2023 05:12:47) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies
Both Images comes with Bookworm, Apache 2.4.56-1~deb11u2, but the Digest and the PHP Version from the image with the TAG 'latest' and the TAG 'wordpress:6.2.2-php8.2-apache' are different.
root@bert ~ # docker pull wordpress:6.2.2-php8.2-apache
6.2.2-php8.2-apache: Pulling from library/wordpress
Digest: sha256:bf91b4919c4da70e1f06c1adf62262bc06f064e891d7735c6d52afc147b3b71d
Status: Image is up to date for wordpress:6.2.2-php8.2-apache
docker.io/library/wordpress:6.2.2-php8.2-apache
root@bert ~ # docker pull wordpress:latest
latest: Pulling from library/wordpress
Digest: sha256:fe04981c522144c731db6db165b896dd890280fdd915df8b5b0505d9ce2878cf
Status: Image is up to date for wordpress:latest
docker.io/library/wordpress:latest
So it seems a Bug in the latest and Debian Bookworm based images with PHP 8.2 and not with image with the TAG 'latest'. I will edit the initial post and concretize it.
changed the title [-]Unable to load dynamic library 'imagick' and 'zip'[/-][+]Unable to load dynamic library 'imagick' and 'zip' in Bookworm based php8.2 images[/+]on Jun 16, 2023
changed the title [-]Unable to load dynamic library 'imagick' and 'zip' in Bookworm based php8.2 images[/-][+]Unable to load dynamic library 'imagick' and 'zip' in Bookworm based php8.2 and php8.1 images[/+]on Jun 16, 2023
Activity
AntonLindell commentedon Jun 15, 2023
I have similar issues when running my ci cd workflow in gitlab. Everything works on local machine though.
[15-Jun-2023 14:06:09 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so (libMagickWand-6.Q16.so.6: cannot open shared object file: No such file or directory)) in Unknown on line 0
[15-Jun-2023 14:06:09 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/zip.so (libzip.so.4: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/zip.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 60 installs, 0 updates, 0 removals
kpurrucker commentedon Jun 15, 2023
@AntonLindell Is it possible, you have on the one hand an old Image and on the other a new one? The Tag from the image is still the same, but since Yesterday the Image based on Bookworm. Older images are based on Bullseye.
In my case the Issues are in the Bookworm Images. If I take the old Bullseye image image with the same TAG everything is fine.
yosifkit commentedon Jun 15, 2023
I'd suggest updating docker and libseccomp on the host. Newer base OS's use newer system calls and an older libseccomp can block them since they are unknown to it. You can verify that it is libseccomp by running the bookworm image with
--security-opt seccomp=unconfined.I am unable to reproduce any errors:
AntonLindell commentedon Jun 16, 2023
You saved the day! Adding bullseye like:
FROM php:8.1-apache-bullseyein the Dockerfile from this repo made my Gitlab job succeed, finally.
kpurrucker commentedon Jun 16, 2023
@yosifkit
I try it again with the lates Image from today on an fresh installed Debian Bookworm and with the latest Docker from https://download.docker.com/linux/debian bookworm stable and no Issue.
With the same Setup and with the latest Image with the TAG wordpress:6.2.2-php8.2-apache I have warnings from PHP:
Both Images comes with Bookworm, Apache 2.4.56-1~deb11u2, but the Digest and the PHP Version from the image with the TAG 'latest' and the TAG 'wordpress:6.2.2-php8.2-apache' are different.
So it seems a Bug in the latest and Debian Bookworm based images with PHP 8.2 and not with image with the TAG 'latest'. I will edit the initial post and concretize it.
[-]Unable to load dynamic library 'imagick' and 'zip'[/-][+]Unable to load dynamic library 'imagick' and 'zip' in Bookworm based php8.2 images[/+]justlevine commentedon Jun 16, 2023
Doesnt seem this is just limited to PHP 8.2. As of yesterday, my CI has been throwing the same error for
wordpress:6.2-php8.1-apacheas well.kpurrucker commentedon Jun 16, 2023
@justlevine I can reproduce this issue also with the PHP 8.1 Image and will edit the Title.
[-]Unable to load dynamic library 'imagick' and 'zip' in Bookworm based php8.2 images[/-][+]Unable to load dynamic library 'imagick' and 'zip' in Bookworm based php8.2 and php8.1 images[/+]use bullseye base image to avoid the following problem:
kpurrucker commentedon Jun 20, 2023
@5t111111 That's work, but is a little bit tricky. The TAG doesn't include the Debian Release an are the same. It's work, if I use a old Container ID:
But this old container has only PHP Version 8.2.6 and not the new 8.2.7.
tianon commentedon Jun 20, 2023
Oh, I found the issue! It is bookworm related, but not the normal seccomp failure 😅
Fix is up at #834 👍
fix bug docker-library#833