Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP imagick install error

Tags:

php

macos

imagick

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

like image 470
Nick D Avatar asked Apr 27 '26 12:04

Nick D


1 Answers

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

like image 123
mcuadros Avatar answered Apr 29 '26 02:04

mcuadros



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!