简体   繁体   中英

PHP imagick install error

I have installed the imagick php module and also installed Image Magick using Brew. Once installed and added to my extensions in php.ini I get this error when Apache (XAMPP) starts up.

dyld: lazy symbol binding failed: Symbol not found: _MagickWandGenesis
Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20090626/imagick.so
Expected in: flat namespace

Google has been no help

Looks like you must compile it by hand as follows:

$ cd /usr/local/src/
$ wget http://pecl.php.net/get/imagick-3.0.1.tgz
$ tar -xzvf imagick-3.0.1.tgz 
$ cd imagick-3.0.1
$ phpize
$ MACOSX_DEPLOYMENT_TARGET=10.6
$ CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
$ CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
$ CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
$ LDFLAGS="-arch i386 -arch x86_64 -bind_at_load"
$ export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET
$ echo $CFLAGS
$ ./configure --with-imagick=/usr/local//Cellar/imagemagick/6.8.0-10
$ make
$ sudo make install
$ sudo vim /etc/php.ini
$ sudo apachectl restart

This is a extract from this post: http://charles.lescampeurs.org/2013/06/18/add-c-header-include-path-pecl

But maybe the easier solution is use the josegonzalez's PHP tap for brew and remove the XAMMP, i use it and works perfect: https://github.com/josegonzalez/homebrew-php

This tab have the most stable packages and recent ones for PHP

Regards

I had the same issue with AMPPS. I installed ImageMagick and imagick with homebrew to try and get it working on top of AMPPS. When I finally got it to compile - I remember symlinks to the right binaries from the AMPPS folder where involved - I got this error.

Turns out not all the libraries where linked properly. I think it was the 'nm' command I used to examine the difference between a working imagick.so file on another computer and the one that wouldn't load. Anyway, I've had it with compiling issues and incompatibilities now and will reinstall everything from the ground up myself to solve it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM