0

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

wget http://pecl.php.net/get/imagick-3.0.1.tgz
tar zxf imagick-3.0.1.tgz
cd imagick-3.0.1
phpize
./configure

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

/local/include/ImageMagick-6/wand

Here is my ImageMagic Version

Version: ImageMagick 6.8.3-7 2013-03-06 Q16 http://www.imagemagick.org
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

1
  • 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, 2013 at 14:00

6 Answers 6

3

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
phpize
./configure --with-php-config=/usr/local/php5/bin/php-config \
--with-imagick=/usr/local/ImageMagick-6.8.4/
make
make install
0
2

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.

0

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.

#!/bin/bash
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)

IM_PREFIX=`$IM_CONFIG --prefix`
if test -r $IM_PREFIX/include/wand/magick-wand.h ; then
  echo "Local IM install has development headers"
else
  echo "Local IM install is missing development headers"
  echo "Try reinstalling source, or 'yum install ImageMagick-devel' package"
fi
4
  • 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, 2013 at 15:19
  • Configure should resolve the include path by use of /local/bin/MagickWand-config. So ./configure --with-imagick=/local will be enough Mar 5, 2013 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, 2013 at 6:27
  • I really am stuck with this :| , ImageMagick is such a headache
    – Synxmax
    Mar 6, 2013 at 7:18
0

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
0

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
-2

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.

1
  • That gives you the PHP 5.2 version of the module.
    – devicenull
    Mar 13, 2013 at 4:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .