PHP版本7.1.3 ;
ImageMagick版本 ImageMagick-7.0.8-3;
PHP扩展imagick版本 imagick-3.4.3RC3;
ImageMagick 安装(第一步)ImageMagick网址
http://www.imagemagick.org/script/install-source.php
首先下载ImageMagick,新版本ImageMagick-7.0.8-3
1.下载ImageMagick安装包
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
2.解压安装包
tar xvfz ImageMagick.tar.gz
3.进入文件
cd ImageMagick-6.8.6-7/
4..设置安装路径.后面安装php扩展需要用到;/usr/local/imagemagick
./configure --prefix=/usr/local/imagemagick
5.编译
make
make install
官网地址:http://pecl.php.net/package/imagick
1.下载imagick-3.4.3RC3
wget https://pecl.php.net/get/imagick-3.4.3RC3.tgz
2.解压安装包
tar zxvf imagick-3.4.3RC3.tgz
3.进入安装文件
cd imagick-3.4.3RC3/
4.执行phpize命令
/usr/local/php/bin/phpize
5.ImageMagick 6.8以上版本目录为/usr/local/include/ImageMagick-X,在configure之前先做下软连接
ln -s /usr/local/imagemagick/include/ImageMagick-7 /usr/local/imagemagick/include/ImageMagick
6.执行configure配置
./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/imagemagick
7.编译
make
make install
==(完成)==
扩展- PHP imagick扩展安装(第二步)可能会遇到的问题解决:
(;configure通过,在make时出现错误error: wand/MagickWand.h: No such file or directory
====解决办法==:==
yum install gtk2-devel
export PKG_CONFIG_PATH=/usr/local/imagemagick/lib/pkgconfig/
;
;然后重新安装imagick
;
cd imagick-3.4.3RC3/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/imagemagick
make
make install)
修改php.ini文件,添加extension=imagick.so
重启nginx和phpnginx重启命令:systemctl restart nginx
php重启命令:systemctl restart php-fpm
(注意:重启前后进程号核对一下是否重启成功)
参考来源(http://www.gemingcao.com/archives/linux-imagemagick-imagick.html)