Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Startup: Unable to load dynamic library 'imagick' on imagick 3.5.0 #443

Closed
mrmkrs opened this issue Jun 28, 2021 · 7 comments
Closed

Comments

@mrmkrs
Copy link

mrmkrs commented Jun 28, 2021

Hi,

our tests are failing because of the new imagick version. If i change pecl install imagick to pecl install imagick-3.4.4 everything works as expected.

/app $ php -v
[28-Jun-2021 08:53:54 UTC] 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
PHP 7.4.20 (cli) (built: Jun  3 2021 22:44:53) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.20, Copyright (c), by Zend Technologies
@Danack
Copy link
Collaborator

Danack commented Jun 28, 2021

Please can you look in the file config.log that should have been generated when you compiled the 3.5.0 version, and search for checking omp_pause_resource_all usability, and post the contents from that here, down to the next line that has a "checking" on it.

And also, search for a file named libgomp.so.1 with something like find / -name libgomp.so.1 and say where it exists on your file system.

@Danack
Copy link
Collaborator

Danack commented Jun 28, 2021

Also, please can you say what platform you're using. And if it's a Mac, try editing the file that was altered by this commit - c9319d1

@mrmkrs
Copy link
Author

mrmkrs commented Jun 28, 2021

Fast response :)

I cannot find this config.log, think it should be in a temp folder which is removed. I'm building this in a docker image on Linux. Found out that there is some compatiblity issue with gd:

FROM php:7.4-fpm-alpine3.12 AS dev

RUN docker-php-source extract \
    && apk --no-cache add libpng-dev libjpeg-turbo-dev imagemagick-dev imagemagick build-base autoconf make \
    && docker-php-ext-configure gd --with-jpeg \
#    && docker-php-ext-install gd \ # uncomment this to make it fail
    && pecl install imagick \
    && docker-php-ext-enable imagick \
    && docker-php-source delete \
    && apk --no-cache del build-base autoconf

This will install everything correct unless you uncomment that line.

When it does work libgomp.so.1 is located at /usr/lib/libgomp.so.1. If it doesn't work, than I cannot find libgomp.so.1.

Hope this info makes sence :)

@Danack
Copy link
Collaborator

Danack commented Jun 28, 2021

So, running the problematic command docker-php-ext-install gd separately, you can see that it's deleting the libgomp and some other libraries:

(12/20) Purging libgomp (9.3.0-r2)
...
(17/20) Purging libmagic (5.38-r0)

Please can you open an issue at https://github.com/docker-library/php/issues ?

Installing software shouldn't delete libraries installed on the system...

@Danack
Copy link
Collaborator

Danack commented Jun 28, 2021

Okay, I'm going to close this.

Although I'm not going to stop people from using Imagick on Alpine, I don't use it myself, so don't really want to get involved with packaging issues, unless they are actually my fault.

Also #328

@Danack Danack closed this as completed Jun 28, 2021
@mrmkrs
Copy link
Author

mrmkrs commented Jun 29, 2021

Thank you for looking into it!

@elomonaco
Copy link

I'm still encountering this issue and this https://github.com/docker-library/php/issues/1173#issuecomment-869870348 helped me get imagick working again in my docker image, it'd be great if GD would not remove what it shouldn't, at least not without checking if something else relies on that library.

basically I just reinstall libgomp after I setup all of my modules and boom, everyone is happy again. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants