1

Pretty much what it sounds like. I did:

brew install imagemagick

That seemed to go well--so the problem is not with imagemagick itself. I then tried to install the PHP extension (updating pear and pecl before trying):

pecl install imagick

It fails. Here's what happens near the end:

running: make
/bin/sh /private/tmp/pear/install/pear-build-brad.garrettZppuRq/imagick-3.0.1/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/imagick -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-brad.garrettZppuRq/imagick-3.0.1/include -I/private/tmp/pear/install/pear-build-brad.garrettZppuRq/imagick-3.0.1/main -I/private/tmp/pear/install/imagick -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/imagick/imagick_class.c -o imagick_class.lo
mkdir .libs
 cc -I. -I/private/tmp/pear/install/imagick -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-brad.garrettZppuRq/imagick-3.0.1/include -I/private/tmp/pear/install/pear-build-brad.garrettZppuRq/imagick-3.0.1/main -I/private/tmp/pear/install/imagick -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/imagick/imagick_class.c  -fno-common -DPIC -o .libs/imagick_class.o
In file included from /private/tmp/pear/install/imagick/imagick_class.c:21:
/private/tmp/pear/install/imagick/php_imagick.h:49:12: fatal error: 'wand/MagickWand.h' file not found
#  include <wand/MagickWand.h>
           ^
1 error generated.
make: *** [imagick_class.lo] Error 1
ERROR: `make' failed

Any ideas?? This is only the umpteenth time I've had issues installing imagemagick on a computer. Seems they change little things here and there all the time (for instance, I've never heard of "magickwand" before now).

Brade
  • 1,481
  • 1
  • 13
  • 21
  • Not going to be much help, but yes installing ImageMagick on a mac is painful and I've lost days trying to get it to work. I'd recommend using a VM (like vagrant) and doing any ImageMagic stuff on there. – Danack May 25 '13 at 13:16
  • Yep, I finally took the plunge and used Vagrant -- love it! – Brade Jun 06 '13 at 19:41
  • http://stackoverflow.com/questions/11865600/imagemagick-brew-installation-with-php-module-in-mac-os-x explains how to install imagick with brew, I succeeded with that. – jarnoan Aug 16 '13 at 07:54

1 Answers1

4

I complied ImageMagick according to http://www.imagemagick.org/script/install-source.php#unix

Then I followed http://verysimple.com/2011/12/21/install-image-magick-for-php-on-osx/

Had the following error fatal error: 'wand/MagickWand.h' file not found

Then I found http://www.imagemagick.org/discourse-server/viewtopic.php?f=10&t=22644

Had to find the solution in config.m4, it was exporting pkgconfig:

export PKG_CONFIG_PATH="`MagickWand-config --prefix`/lib/pkgconfig/"

Then I configured with the following:

LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure --with-imagick=/usr/local
Jeff
  • 6,643
  • 3
  • 25
  • 35
michalzuber
  • 5,079
  • 2
  • 28
  • 29
  • 2
    This worked for me, except I had to use the following: CPPFLAGS="-I/usr/local/include/ImageMagick-6" instead of CPPFLAGS="-I/usr/local/include" – Filipiz Jun 28 '13 at 22:03
  • it appears that the static path `/usr/local/opt/imagemagick/lib/pkgconfig` is the same as the `PKG_CONFIG_PATH="$(MagickWand-config --prefix)/lib/pkgconfig/"` you suggest – sds Dec 01 '16 at 17:31