标签:imagick
参考链接:http://my.oschina.net/u/142836/blog/169382
需要下载的东西:
libwebp-0.5.1.tar.gz wget ImageMagick6.9.5.tar.gz wget http://git.imagemagick.org/repos/ImageMagick/repository/archive.tar.gz?ref=6.9.5-0 imagick-3.1.2.tgz https://pecl.php.net/get/imagick-3.1.2.tgz
一定要用ImageMagick6.9.5.tar.gz这个包,因为官方最新版的是ImageMagick-7.0.2-4,安装后有问题.
一.
yum -y install libpng-devel libjpeg-devel
二.安装webo库
[root@testserver-1 src]# tar -zxvf libwebp-0.5.0.tar.gz [root@testserver-1 src]# cd libwebp-0.5.0/ [root@testserver-1 libwebp-0.5.0]# ./configure && make && make install [root@testserver-1 libwebp-0.5.0]# cp /usr/local/lib/libwebp.so.6.0.0 /usr/lib64/ [root@testserver-1 libwebp-0.5.0]# ln -s /usr/lib64/libwebp.so.6.0.0 /usr/lib64/libwebp.so.6 [root@testserver-1 libwebp-0.5.0]# ln -s /usr/lib64/libwebp.so.6.0.0 /usr/lib64/libwebp.so
安装ImageMagick
[root@testserver-1 src]# tar -zxvf ImageMagick6.9.5.tar.gz [root@testserver-1 src]# cd ImageMagick-6.9.5/ [root@testserver-1 ImageMagick-6.9.5]# ./configure --prefix=/usr/local/imagemagick --with-webp [root@testserver-1 ImageMagick-6.9.5]# make && make install [root@testserver-1 src]# ln -s /usr/local/imagemagick/include/ImageMagick-6 /usr/local/imagemagick/include/ImageMagick
不同的地方:
[root@testserver-1 src]# vim /etc/profile export MAGICK_HOME=/usr/local/imagemagick/ export PATH=$MAGICK_HOME/bin:$PATH [root@testserver-1 src]# source /etc/profile
没有上面那一步,可能会找不到convert命令。
安装php扩展
tar -zxvf imagick-3.1.0RC2.tgz cd imagick-3.1.0RC2/usr/local/php/bin/phpize export PKG_CONFIG_PATH=/usr/local/imagemagick/lib/pkgconfig ./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/imagemagick make && make install
有两个坑,就是用官方的最新版本ImageMagick,不正常.
另外一个是,要source 环境
可以参考:http://www.imagemagick.org/script/binary-releases.php/
标签:imagick
原文地址:http://huwei555.blog.51cto.com/1347480/1826692