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 }}
This repository was archived by the owner on May 21, 2025. It is now read-only.
The Docker image pulls Imagick 3.5.0 via PECL. However, the PHP extension requires a dependency on a shared library which isn't included in the Dockerfile. As a result, PHP will throw PHP core warnings and CraftCMS will yield PHP errors both via PHP-FPM as well as via the CLI.
Steps to reproduce
Set up a fresh environment and use the Dockerfile to build an image. (I use Docker Compose)
In my case, I try to restore a SQL dump using the craft command via the docker CLI tool:
PHP Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so (Error loading shared library libgomp.so.1: No such file or directory (needed by /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so))) in Unknown on line 0
Restoring database backup ... done
PHP Core Warning 'yii\base\ErrorException' with message 'PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so (Error loading shared library libgomp.so.1: No such file or directory (needed by /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so)))'in ./Unknown:0
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleFatalError()#1 {main}
This caught my eye: Error loading shared library libgomp.so.1: No such file or directory (needed by /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so)
So I added libgomp to the Dockerfile, like below, and rebuild the image. That solved the issue for me.
RUN set -ex && \
apk --no-cache add \
...
libjpeg-turbo \
libgomp \
freetype-dev \
...
Description
The Docker image pulls Imagick 3.5.0 via PECL. However, the PHP extension requires a dependency on a shared library which isn't included in the Dockerfile. As a result, PHP will throw PHP core warnings and CraftCMS will yield PHP errors both via PHP-FPM as well as via the CLI.
Steps to reproduce
craftcommand via thedockerCLI tool:$ docker exec -it project_name php craft db/restore /var/www/storage/backups/project-- 2021-06-30-084743--v3.6.15.sqlI get these errors:
This caught my eye:
Error loading shared library libgomp.so.1: No such file or directory (needed by /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so)So I added
libgompto the Dockerfile, like below, and rebuild the image. That solved the issue for me.Additional info