GraphicsMagick 是一个很高效的图片处理工具,跟 ImageMagic 类似,接口也几乎跟 ImageMagic 全部兼容。事实上,GraphicsMagick是从 ImageMagick 5.5.2 分支出来的,但是现在他变得更稳定和优秀。

项目地址:http://www.graphicsmagick.org/index.html

下载地址:http://www.graphicsmagick.org/download.html

最新版本:ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/GraphicsMagick-LATEST.tar.gz

#下载安装:
wget ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/GraphicsMagick-LATEST.tar.gz
tar zxvf GraphicsMagick-LATEST.tar.gz
cd GraphicsMagick-1.3.12/
CFLAGS="-O3 -fPIC"
./configure --prefix=/elain/apps/graphicsmagick --enable-shared
make
make install
cd ..
ln -s /elain/apps/graphicsmagick/bin/* /usr/bin/

#PHP 扩展地址:http://pecl.php.net/package/gmagick
#安装:
wget http://pecl.php.net/get/gmagick-1.0.9b1.tgz
tar zvxf gmagick-1.0.9b1.tgz
cd gmagick-1.0.9b1/
/elain/apps/php/bin/phpize
./configure --with-php-config=/elain/apps/php/bin/php-config
make
make install
cd ..

然后在 php.ini 里添加一行:

extension="gmagick.so"

重启 php
/elain/apps/php/sbin/php-fpm reload

验证安装:
1、打开phpinfo.php 查看加载
2、在服务器上运行 gm version
[root@elain ~#]gm version
[root@elain ~#]gm version
GraphicsMagick 1.3.12 2010-03-08 Q8 http://www.GraphicsMagick.org/
Copyright (C) 2002-2010 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.

Feature Support:
Thread Safe              yes
Large Files (> 32 bit)   yes
Large Memory (> 32 bit)  yes
BZIP                     yes
DPS                      no
FlashPix                 no
FreeType                 yes
Ghostscript (Library)    no
JBIG                     no
JPEG-2000                no
JPEG                     yes
Little CMS               no
Loadable Modules         yes
OpenMP                   yes (200505)
PNG                      yes
TIFF                     yes
TRIO                     no
UMEM                     no
WMF                      no
X11                      yes
XML                      yes
ZLIB                     yes

Host type: x86_64-unknown-linux-gnu

Configured using the command:
./configure  '--prefix=/elain/apps/graphicsmagick' '--enable-shared' --enable-ltdl-convenience

Final Build Parameters:
CC       = gcc -std=gnu99
CFLAGS   = -fopenmp -g -O2 -Wall -pthread
CPPFLAGS = -I/usr/include/freetype2 -I/usr/include/libxml2
CXX      = g++
CXXFLAGS = -pthread
LDFLAGS  = -L/usr/lib -L/usr/lib
LIBS     = -ltiff -lfreetype -ljpeg -lpng -lXext -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lm -lgomp -lpthread

转载请注明: 转载自http://www.elain.org

本文链接地址:GraphicsMagick扩展配置安装