php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75890 Unable to load dynamic library 'imagick'
Submitted: 2018-01-30 18:16 UTC Modified: 2018-02-20 09:24 UTC
From: simbiat at outlook dot com Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 7.2.1 OS: Windows 10
Private report: No CVE-ID: None
 [2018-01-30 18:16 UTC] simbiat at outlook dot com
Description:
------------
7.2.1 (and seems like 7.2, too) fails to load Imagick library with error like this:
PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick' (tried: C:\\\\WebServer\\php\\ext\\imagick (\xef\xbf\xbd\xef\xbf\xbd \xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd \xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd \xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd.\r\n), C:\\\\WebServer\\php\\ext\\php_imagick.dll (\xef\xbf\xbd\xef\xbf\xbd \xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd \xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd \xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd.\r\n)) in Unknown on line 0

This happens with both "imagick" entry in .ini and with "php_imagick.dll". With the latter PHP tries to load "php_php_imagick.dll.dll"


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-01 14:50 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2018-02-01 14:50 UTC] ab@php.net
Thanks for the report. It actually looked like a memory corruption, but actually it seems to be a codepage issue. Any chance you're on a system with a non latin1 or ascii codepage? The message is localized, so this is perhaps the reason for this fun output.

Thanks.
 [2018-02-01 17:38 UTC] simbiat at outlook dot com
I am on Windows 10 x64 with Russian MUI, but this is what I actually see in the log. I am now using 7.2.2 from https://www.apachelounge.com/viewtopic.php?t=6359 and what fixed this for me is using ImageMagick ImageMagick 6.9.9-30 Q16 x64

In github thread https://github.com/mkoppanen/imagick/issues/224 it's said, that using latest snapshot of imagick library actually works with ImageMagick 7 even.

While, this can be considered a fix, I'd prefer to treat this as a workaround. At the least, it's not obvious from the error below that it's caused by wrong ImageMagick version (if it really IS the case). Firstly, php does try for library with wrong name when using "new" format ("imagick"), which is wrong. Secondly, I think it should be possible to present this error message as something human-readable and understandable, like "ImageMagick version x is not found in the system". Currently this is too ambiguous to actually debug.
 [2018-02-01 19:41 UTC] ab@php.net
Thanks for the further info. Notes to that

- please use the official windows.php.net builds when reporting issues
- please use the builds from pecl.php.net, be it release or snapshot
- specifically for imagic, the exact dependencies as provided in http://windows.php.net/downloads/pecl/deps/ need to be used

The output looks actually like some misinterpreted bytes, as that part currently doesn't convert from the system codepage to default_charset. This needs to be evaluated more on a non ASCII system. With a codepage of 437, for example, you'd see 

php.exe -n -d extension=hellothere -m
PHP Warning:  PHP Startup: Unable to load dynamic library 'hellothere' (tried: C:\php\ext\hellothere (The specified module could not be found.), C:\php\ext\php_hellothere.dll (The specified module could not be found.)) in Unknown on line 0
[PHP Modules]
bcmath
calendar
.....


Now, you could map, what all those hex bytes in the output are supposed to mean. Anyway, please don't bug the imagick devs with this issue, it is in no case an imagic issue. I'm also going to put a note on the GitHub ticket there.

Thanks.
 [2018-02-20 09:24 UTC] simbiat at outlook dot com
-Status: Feedback +Status: Closed
 [2018-02-20 09:24 UTC] simbiat at outlook dot com
Using older version of ImageMagick helped
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Mar 18 18:01:28 2019 UTC