Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImageMagick - PECL issue - Cannot locate header file MagickWand.h

We are getting this error while installing ImageMagick PECL:

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.6 Q16 checking for MagickWand.h header file... configure: error: Cannot locate header file MagickWand.h ERROR: `/root/tmp/pear/imagick/configure --with-imagick' failed extension imagick.so installed in /usr/local/lib/php.ini /usr/local/bin/php does not have a php.ini Tidying /usr/local/cpanel/3rdparty/php/53/etc/php.ini... No changes

Any idea how to fix this ?

like image 335
capte Avatar asked Jul 24 '13 14:07

capte


4 Answers

This thread is old, but I solved this issue today on a Centos 7 by installing ImageMagick-devel package:

yum install ImageMagick-devel

Hope this helps.

like image 79
e-Jim Avatar answered Nov 11 '22 14:11

e-Jim


Steps:

  1. apt-get install libmagickwand-dev
  2. /opt/lampp/bin/pecl install imagick
  3. gedit /opt/lampp/etc/php.ini
  4. add "extension=imagick.so" to php.ini
like image 35
H Arif Avatar answered Nov 11 '22 16:11

H Arif


Probably its looking for the file MagickWand.h and unable to see that file in the defined location. Try these steps

wget http://pecl.php.net/get/imagick-3.1.0RC2.tgz
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;

to

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
phpize
./configure
make
make install
like image 4
Leo Prince Avatar answered Nov 11 '22 15:11

Leo Prince


Perhaps this http://thomas.bindzus.me/2013/08/11/building-pecl-imagick-for-php-5-5-1-on-centos-6-4/ can be of some help to others.

The solution described by Leo Prince almost worked for me, just had to set PKG_CONFIG_PATH, and perhaps that's just my server setup which isn't as perfect as it should be.

Here is what I did step-by-step (I'm running CentOS 6.4, Apache 2.4.6, and PHP 5.5.1):

wget http://pecl.php.net/get/imagick-3.1.0RC2.tgz
tar zxf imagick-3.1.0RC2.tgz
cd imagick-3.1.0RC
phpize
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure –with-imagick
make
make install
echo extension=imagick.so > /etc/php.d/imagick.ini
service httpd restart
php -m | grep imagick
like image 2
Thomas Bindzus Avatar answered Nov 11 '22 14:11

Thomas Bindzus