参考链接: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库
[[email protected] src]# tar -zxvf libwebp-0.5.0.tar.gz [[email protected] src]# cd libwebp-0.5.0/ [[email protected] libwebp-0.5.0]# ./configure && make && make install [[email protected] libwebp-0.5.0]# cp /usr/local/lib/libwebp.so.6.0.0 /usr/lib64/ [[email protected] libwebp-0.5.0]# ln -s /usr/lib64/libwebp.so.6.0.0 /usr/lib64/libwebp.so.6 [[email protected] libwebp-0.5.0]# ln -s /usr/lib64/libwebp.so.6.0.0 /usr/lib64/libwebp.so
安装ImageMagick
[[email protected] src]# tar -zxvf ImageMagick6.9.5.tar.gz [[email protected] src]# cd ImageMagick-6.9.5/ [[email protected] ImageMagick-6.9.5]# ./configure --prefix=/usr/local/imagemagick --with-webp [[email protected] ImageMagick-6.9.5]# make && make install [[email protected] src]# ln -s /usr/local/imagemagick/include/ImageMagick-6 /usr/local/imagemagick/include/ImageMagick
不同的地方:
[[email protected] src]# vim /etc/profile export MAGICK_HOME=/usr/local/imagemagick/ export PATH=$MAGICK_HOME/bin:$PATH [[email protected] 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/
时间: 2024-11-06 09:25:41