Centos安装ImageMagick 与 imagick for php详解
ImageMagick是一套软件系列,主要用于图片的创建、编辑以及转换等

Centos 安装ImageMagick
yum install ImageMagick-devel
yum install php-pear
这两个是支持库 必须先安装好
下载安装ImageMagick
代码如下
wget http://www.imagemagick.org/download/ImageMagick-6.9.10-6.tar.gz
// (ftp://mirror.aarnet.edu.au/pub/imagemagick/ImageMagick-6.6.8-10.tar.gz
tar -xzvf ImageMagick-6.6.8-10.tar.gz)//
tar -xzvf ImageMagick-6.9.10-6.tar.gz
./configure --prefix=/usr/local/imagemagick
make
make install
测试ImageMagick是否可以正常运行:
/usr/local/imagemagick/bin/convert -version
下载安装Imagick
注:安装该扩展不要求安装ImageMagick
代码如下
//( wget http://pecl.php.net/get/imagick-3.1.0RC1.tgz)//
wget http://pecl.php.net/get/imagick
tar -xzvf imagick-3.1.0RC1
phpize (此处记得要带上php的安装路径)
./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/imagemagick 注意php的安装路径
make
make install
make install执行结果显示:
代码如下
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
Installing header files: /usr/local/php/include/php/
生成imagick.so到/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/,
然后手动配置php.ini使其生效
加载imagick到php
在 php.ini 加上
extension=imagick.so
如果 编译安装Fileinfo的时候,报configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers
就是缺少 re2c
make && make install
下载地址可能不对 到这里去找最新的版本
http://sourceforge.net/projects/re2c/files/
这篇博文很不错
https://www.cnblogs.com/kevingrace/p/5947695.html
版权声明
本文仅代表作者观点,不代表Csuper立场。
本文系作者授权百度百家发表,未经许可,不得转载。