icoolmj 2012-03-22
linux下安装ImageMagick及其phpimagick扩展;
安装之前必须安装lib
freetype-2.4.0.tar.gz
libtool-2.2.6a.tar.gz
libjpeg-devel
jpegsrc.v6b.tar.gz
libpng-1.2.12.tar.gz
zlib-1.2.8.tar.gz
1下载ImageMagick-6.7.1-6
wgetftp://ftp.u-aizu.ac.jp/pub/graphics/image/ImageMagick/imagemagick.org/ImageMagick.tar.gz
[root@localhostzhangminsong]#ll
total12380
-rw-r--r--1rootroot12656433Aug1816:47ImageMagick.tar.gz
2解压
[root@localhostzhangminsong]#tar-xzvfImageMagick.tar.gz
3编译安装
[root@localhostzhangminsong]#cdImageMagick-6.7.1-6
[[email protected]]#./configure-prefix=/usr/local/imagemagick-enable-lzw-with-modules
如果报错:
make[1]:***[wand/wand_libMagickWand_la-wand-view.lo]Error1
makeclean
makecleanall
makeinstall
查看一下
[root@localhostzhangminsong]#convert-version
Version:ImageMagick6.7.1-62011-08-17Q16http://www.imagemagick.org
Copyright:Copyright(C)1999-2011ImageMagickStudioLLC
Features:OpenMP
测试一下
[[email protected]]#pwd
/root/zhangminsong/ImageMagick-6.7.1-6
[[email protected]]#cdimages/
[root@localhostimages]#convert-sample25%x25%wizard.jpgtest.jpg
ok了
开始装imagick的PHP扩展
注意:安装imagick扩展时需要PHP>=5.1.3,ImageMagick>=6.2.4
获取imagick
[root@localhostzhangminsong]#wgethttp://pecl.php.net/get/imagick-3.1.0RC2.tgz
--2011-08-1817:44:48--http://pecl.php.net/get/imagick-3.1.0b1.tgz
Resolvingpecl.php.net...76.75.200.106
Connectingtopecl.php.net|76.75.200.106|:80...connected.
HTTPrequestsent,awaitingresponse...200OK
Length:93269(91K)[application/octet-stream]
Savingto:`imagick-3.1.0b1.tgz'
100%[===============================================================================================================================================================>]93,26955.6K/sin1.6s
2011-08-1817:44:51(55.6KB/s)-`imagick-3.1.0b1.tgz'saved[93269/93269]
解压
[root@localhostzhangminsong]#tarzxvfimagick-3.1.0RC2.tgz
package.xml
imagick-3.1.0b1/examples/polygon.php
imagick-3.1.0b1/examples/captcha.php
imagick-3.1.0b1/examples/thumbnail.php
imagick-3.1.0b1/examples/watermark.php
imagick-3.1.0b1/config.m4
imagick-3.1.0b1/config.w32
imagick-3.1.0b1/CREDITS
imagick-3.1.0b1/imagick.c
imagick-3.1.0b1/imagick_class.c
imagick-3.1.0b1/imagickdraw_class.c
imagick-3.1.0b1/imagickpixel_class.c
imagick-3.1.0b1/imagickpixeliterator_class.c
imagick-3.1.0b1/imagick_helpers.c
imagick-3.1.0b1/imagick_file.c
imagick-3.1.0b1/php_imagick.h
imagick-3.1.0b1/php_imagick_defs.h
imagick-3.1.0b1/php_imagick_helpers.h
imagick-3.1.0b1/php_imagick_macros.h
imagick-3.1.0b1/php_imagick_shared.h
imagick-3.1.0b1/php_imagick_file.h
imagick-3.1.0b1/TODO
imagick-3.1.0b1/INSTALL
imagick-3.1.0b1/ChangeLog
phpize
[root@localhostzhangminsong]#cdimagick-3.1.0RC2
[[email protected]]#/opt/modules/php5.3.5/bin/phpize
Configuringfor:
PHPApiVersion:20090626
ZendModuleApiNo:20090626
ZendExtensionApiNo:220090626
配置编译
[root@localhostzhangminsong]#./configure--with-php-config=/opt/modules/php5.3.5/bin/php-config--with-imagick=/usr/local/imagemagick
*此处如果出错,请执行
ln-s/usr/local/imagemagick/include/ImageMagick-6/usr/local/imagemagick/include/ImageMagick
[root@localhostzhangminsong]#make&&makeinstall
*此处如果出错,请执行
exportPKG_CONFIG_PATH=/********/imagemagick/lib/pkgconfig
重新编译。ok
编译成功后会在php扩展目录生成imagick.so
我的路径是/opt/modules/php5.3.5/lib/php/extensions/no-debug-non-zts-20090626/
然后再php.ini里面加上
extension="imagick.so"
重启phpphpinfo()看看
安装完成。。。。
出处:
http://xiaosu.blog.51cto.com/2914416/688822
http://www.cnblogs.com/gaohj/p/3152646.html