MacOS – How to install imagick via homebrew


I am trying to install imagick using homebrew. The issue is that MagickWand libaries cannot be found.

$ brew install php54-imagick
==> Downloading
Already downloaded: /opt/boxen/cache/homebrew/php54-imagick-3.1.0RC2.tgz
==> Patching
patching file imagick-3.1.0RC2/config.m4
==> PHP_AUTOCONF="/opt/boxen/homebrew/opt/autoconf/bin/autoconf" PHP_AUTOHEADER="/opt/boxen/homebrew/opt/autoconf/bin/autoheader" /opt/boxen/homebrew/Cellar/php54/5.4.26/bin/phpize
==> ./configure --prefix=/opt/boxen/homebrew/Cellar/php54-imagick/3.1.0RC2 --with-php-config=/opt/boxen/homebrew/Cellar/php54/5.4.26/bin/php-config
checking for awk... awk
checking if awk is broken... no
checking whether to enable the imagick extension... yes, shared
checking whether to enable the imagick GraphicsMagick backend... no
checking ImageMagick MagickWand API configuration program... configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.

If reporting this issue please do so at (not Homebrew/homebrew):

There is an issue on github for that bug yet it got closed. There seemed to be a fix for that bug, but it got closed and cherry-picking is not possible for me.

Best Answer

As mentioned on this answer :

you can try these steps:

tar zxf imagick-3.1.0RC2.tgz

Edit the file imagick-3.1.0RC2/config.m4 line number 55.

Make changes like this, from

if test -r $WAND_DIR/include/ImageMagick/wand/MagickWand.h;


if test -r $WAND_DIR/include/ImageMagick-6/wand/MagickWand.h;

Note this difference made in the imagick version number. After that try the conventional installation procedures

cd imagick-3.1.0RC2
make install