最新消息:走过的,离开的,已经错过,新开始2016

安装Imagemagick

技术随笔 果果 5195浏览 0评论

阿里云客户,系统Red Hat Enterprise Linux Server release 5.4  64bit,之前安装了  LuManager 集成的php 环境和 控制面板,现在要安装 Imagemagick 以及相应的php扩展

下载相应的  ImageMagick-6.8.6  和 magick-3.0.1

tar zxvf ImageMagick.tar.gz
cp -a  ImageMagick-6.8.6-6/ /usr/local/

/usr/local/

./configure
make
make install
cd ../

一路顺利编译完成  下面编译php 扩展

tar zxvf imagick-3.0.1.tgz
cd imagick-3.0.1/
/usr/local/php_fcgi/bin/phpize  //LuManager 的 nginx  php的路径
./configure –with-php-config=/usr/local/php_fcgi/bin/php-config
make
make install
可在
./configure –with-php-config=/usr/local/php_fcgi/bin/php-config 时报错checking for MagickWand.h header file… configure: error: Cannot locate header file MagickWand.h

旧版本和新版文件夹目录是有区别的,旧的是放在/usr/local/include/ImageMagick目录的,而ImageMagick 6.8则是放在/usr/local/include/ImageMagick-6这样做一个链接

 ln -s /usr/local/include/ImageMagick-6 /usr/local/include/ImageMagick
继续make  可又报错了[imagick_class.lo] Error 1

解决

./configure  之前先指定

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig 

重新

./configure –with-php-config=/usr/local/php_fcgi/bin/php-config
make

make install

 

顺利编译完成

cd   /usr/local/php_fcgi/lib
vi php.ini

在最后 加入一行  extension = “imagick.so”

重载 nginx  查看 phpinfo  已经可以看到 Imagemagick 了

转载请注明:果果.IT » 安装Imagemagick

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址