https://www.cnblogs.com/haiwei_sun/articles/9950563.html
https://blog.csdn.net/zhemejinnameyuanxc/article/details/83114470
https://blog.csdn.net/snow_small/article/details/79173575
[root@localhost download]# wget http://www.imagemagick.org/download/ImageMagick.tar.gz
[root@localhost download]# tar -xzvf ImageMagick.tar.gz
[root@localhost download]# cd ImageMagick-7.0.7-22/
[root@localhost ImageMagick-7.0.7-22]# ./configure --prefix=/usr/local/imagemagick
[root@localhost ImageMagick-7.0.7-22]# make
[root@localhost ImageMagick-7.0.7-22]# make install
[root@localhost ImageMagick-7.0.7-22]# /usr/local/imagemagick/bin/convert -version
Version: ImageMagick 7.0.7-22 Q16 x86_64 2018-01-26 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP
Delegates (built-in): fontconfig freetype jng jpeg png x xml zlib
[root@localhost download]# wget http://pecl.php.net/get/imagick-3.4.3.tgz
[root@localhost download]# tar -xzvf imagick-3.4.3.tgz
[root@localhost download]# cd imagick-3.4.3
[root@localhost imagick-3.4.3]# /usr/local/php/bin/phpize
[root@localhost imagick-3.4.3]# ./configure --with-php-config=/usr/local/php/bin/php-config
[root@localhost imagick-3.4.3]# ./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/imagemagick
[root@localhost imagick-3.4.3]# make && make install
!!./configure --with-php-config=/usr/local/php/bin/php-config 出现错误
configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
安装如下软件即可:
yum install ImageMagick-devel
在安装 ImageMagick-devel 又出现错误:
Transaction check error:file /usr/lib64/libgs.so.9 from install of libgs-9.25-2.el7_7.3.x86_64 conflicts with file from package ghostscript-9.07-18.el7.x86_64
file /usr/lib64/libijs-0.35.so from install of libgs-9.25-2.el7_7.3.x86_64 conflicts with file from package ghostscript-9.07-18.el7.x86_64
安装包冲突(文档转换器,我这边不需要,可以直接卸载):
先删除 yum remove ghostscript-9.07-18.el7.x86_64
再 yum install ImageMagick-devel
再 pecl install imagick 这个命令等于第3大步所有命令。
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /usr/local/php-7.0.14/lib/php/extensions/no-debug-non-zts-20151012/
Installing header files: /usr/local/php-7.0.14/include/php/
[root@localhost imagick-3.4.3]# vi /usr/local/php/etc/php.ini
打开/usr/local/php/etc/php.ini
在末尾加入:extension = imagick.so
[root@localhost imagick-3.4.3]# /etc/init.d/php-fpm restart
[root@localhost imagick-3.4.3]# php -m | grep imagick
imagick