Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to configure and make install imagick extension, here is commands that i used

tar zxf imagick-3.0.1.tgz
cd imagick-3.0.1

But this error happen :

checking for MagickWand.h header file... configure: error: Cannot locate header file MagickWand.h

I found MagickWand.h at this location


Here is my ImageMagic Version

Version: ImageMagick 6.8.3-7 2013-03-06 Q16
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP Modules
Delegates: bzlib djvu fontconfig freetype gslib jng jp2 jpeg lcms openexr pango png ps rsvg tiff wmf x xml zlib

Is there any option with configure so i can locate that header file ?

am i installing right version since my php is 5.3 and ImageMagick 6.8.3-7 trying to install imagick-3.0.1 !?

Thanks in advance

share|improve this question
Hi I also struggle in a half-day that i tried all of things above. But it doesn't work Finally, I decided to reading the configure file. Therefore, some miss-configurations about Magickwand.h. You should search" wand", for example, and modify the path to point to your specific Magickwand.h To file down where is your MaigickWand, jus run above shell-script snippet... In my case, in the path, which point to MagickWand.h is missed "6" in Imagick word – user166110 Mar 23 '13 at 14:00
up vote 3 down vote accepted

You can use pkg-config to locate header file MagickWand.h Suppose you install ImageMagick in /usr/local/ImageMagick-6.8.4 and imagick-3.0.1

cd imagick-3.0.1
export PKG_CONFIG_PATH=/usr/local/ImageMagick-6.8.4/lib/pkgconfig
./configure --with-php-config=/usr/local/php5/bin/php-config \
make install
share|improve this answer

I'd suggest you drop your custom compiled PHP and switch over the to the version provided by IUS. Specifically, you'd install the following packages after configuring the IUS repo:

php53u php53u-pecl-imagick

This will probably make things significantly easier for you, as you won't have to worry about compiling this module anymore.

share|improve this answer

You'll need to tell imagick where the header files are located.

./configure --with-imagick=/local

Use the help switch to list additional configuration options.

./configure --help

[edit] Confirm Local Install

The configuration script will look for MagickWand-config and/or Wand-config executable to determine where include headers are located. MagickWand-config is selected by checking if the executable exists in $PHP_MAGICK/bin/MagickWand-config; where, $PHP_MAGICK is the path provided by --with-imagick=PATH, or /usr/local or /usr.

Here's a quick script to verify your local IM install can be used by PHP Imagick extension.

IM_CONFIG=`which MagickWand-config`
# Or use different IM location by setting previous line with absolute 
# path to executable config (ie. IM_CONFIG=/local/bin/MagickWand-config)

if test -r $IM_PREFIX/include/wand/magick-wand.h ; then
  echo "Local IM install has development headers"
  echo "Local IM install is missing development headers"
  echo "Try reinstalling source, or 'yum install ImageMagick-devel' package"
share|improve this answer
I did this ./configure --with-imagick=/local/include/ImageMagick-6 --with-php-config=/usr/bin/php-config but still getting same error !? – Synxmax Mar 5 '13 at 15:19
Configure should resolve the include path by use of /local/bin/MagickWand-config. So ./configure --with-imagick=/local will be enough – emcconville Mar 5 '13 at 17:00
Still Same checking ImageMagick MagickWand API configuration program... found in /usr/local/bin/MagickWand-config checking if ImageMagick version is at least 6.2.4... found version 6.8.3 Q16 checking for MagickWand.h header file... configure: error: Cannot locate header file MagickWand.h – Synxmax Mar 6 '13 at 6:27
I really am stuck with this :| , ImageMagick is such a headache – Synxmax Mar 6 '13 at 7:18

I have the same question. And the above ways can't resove it.
I read the configure file and I found the location of imagickwand.h is wrong. I resolved it by running the following command:

ln -s /usr/local/ImageMagick/include/ImageMagick-6 /usr/local/ImageMagick/include/ImageMagick
share|improve this answer

I know this question is very old, but I must put my contribution.

If running php 5.4. just run these two lines of code:

pear config-set preferred_state beta
pecl install imagick
share|improve this answer

Use 'yum install php-magickwand' after enabling epel repository. Installing by source on production systems is not a good idea as uninstall, down-grade, upgrade etc. is not supported.

share|improve this answer
That gives you the PHP 5.2 version of the module. – devicenull Mar 13 '13 at 4:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.