Search code examples
phpapachehomebrewimagickxz

Homebrews php56-imagick module can not load because of liblzma


I installed php56 via homebrew on OS X Yosemite. It's a working installation. I just added now the ImageMagick and php56-imagick packages.

Apache is running ok, php -i shows the imagick module. But the apache-server can not load the module on startup with following warning:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-imagick/imagick.so' - dlopen(/usr/local/opt/php56-imagick/imagick.so, 9): Library not loaded: /usr/local/opt/xz/lib/liblzma.5.dylib\n
Referenced from: /usr/local/opt/imagemagick/lib/libMagickWand-6.Q16.2.dylib\n
Reason: Incompatible library version: libMagickWand-6.Q16.2.dylib requires version 8.0.0 or later, but liblzma.5.dylib provides version 6.0.0 in Unknown on line 0

Therefore there is no imagick class in php.

The package xz (providing liblzma) is up2date.

Is it a path issue (has /usr/lib precedence over /usr/local/lib)?

/usr/lib/liblzma.5.dylib (probably OS X provided)
/usr/local/Cellar/xz/5.2.2/lib/liblzma.5.dylib (homebrew)
/usr/local/lib/liblzma.5.dylib (link to homebrew)

Replacing /usr/lib/liblzma.5.dylib almost broke the OS X system.

Or should I report the issue to:

  • xz
  • homebrew
  • ImageMagick

?

Thanks for a suggestion.

J.


Solution

  • try below command, worked for me

    brew reinstall php56-imagick --build-from-source
    

    Source