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

与世无争的帅哥 提交于 2019-12-10 12:39:16

问题


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 ?


回答1:


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.




回答2:


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



回答3:


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



回答4:


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



回答5:


First run following commands

1. "WHM Home » Software » Rebuild RPM Database"

2. yum install ImageMagick ImageMagick-devel

3. yum install pcre-devel

Then go to

Go to WHM -> Software -> Module Installers -> PHP Pecl (manage). On the 
box below “Install a PHP Pecl” enter “imagick” and click “Install Now” 
button – that’s all.  Restart Apache.

Above steps worked for me.



来源:https://stackoverflow.com/questions/17836893/imagemagick-pecl-issue-cannot-locate-header-file-magickwand-h

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!