ImageMagick 安装

下載
  • http://www.imagemagick.org/download/ //ex. ImageMagick-6.9.1-1.tar.gz 
  • http://pecl.php.net/get/imagick-3.1.2.tgz
  • http://prdownloads.sourceforge.net/optipng/optipng-0.7.5.tar.gz?download
  • http://www.lcdf.org/gifsicle/gifsicle-1.87.tar.gz
  • http://jpegclub.org/jpegcrop.tar.gz
  1. 將檔案放至/tmp/安裝
    /tmp/
  2. 安裝optipng-0.7.5.tar.gz(3th party)
    tar -zxvf optipng-0.7.5.tar.gz
    cd optipng-0.7.5
    ./configure
    make && make install
  3. 安裝gifsicle-1.87.tar.gz(3th party)
    tar -zxvf gifsicle-1.87.tar.gz
    cd gifsicle-1.87
    ./configure
    make && make install
  4. 安裝jpegcrop.tar.gz(若第6點imagick安裝失敗才需要安裝此步驟)
    tar -zxvf jpegcrop.tar.gz
    cd jpegcrop/jpeg-9a
    ./configure
    make libdir=/usr/lib64
    make libdir=/usr/lib64 install
  5. yum安裝相關lib
    yum install libjpeg libjpeg-devel libpng libpng-devel libtiff libtiff-devel
  6. 安裝ImageMagick-6.9.1- 1.tar.gz
    tar -zxvf ImageMagick-6.9.1- 1.tar.gz
    cd ImageMagick-6.9.1- 1
    ./configure --prefix=/usr/local/imagemagick --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes --with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes
    若出現「undefined reference to `jpeg_default_qtables'」
    表示第4步沒裝好,再重安裝試試

    make && make install
  7. 安裝imagick-3.1.2.tgz
    pecl install imagick-3.1.2.tgz

    安裝過程中請輸入:/usr/local/imagemagick
  8. 安裝完成後檢查/usr/lib64/php/modules是否有imagick.so
    ls /usr/lib64/php/modules/ | grep imagick.so
  9. 新增/etc/php.d/imagick.ini,內容如下:
    ; Enable imagick extension module

    extension=imagick.so
    確認extension=imagick.so是否有於/etc/php.ini定義過,若有請移除。
  10. 重新啟動
    service httpd restart
  11. 確認JPG, JPEG, PNG, PNG00, PNG24, PNG32, PNG48, PNG64,PNG8格式是否存在
    php -i | grep "ImageMagick supported formats"
    php -m | grep imagick
Thanks for the hard work~  Demo
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值