找了几篇外文的,写的很好,按照参考安装成功!

http://www.tecmint.com/install-imagemagick-in-linux/

ImageMagick is an free open source simple software suite for any kind of image manipulation that is used for creating, editing, converting, displaying image files. It can able to read and write over 200 image files such as JPEGGIFPNGTIFF and Photo CD image formats and it is also used for thumbnail or captcha generation. It also includes command line options for creating transparent or animated gif image formats and many more feature like resize, sharpen, rotate or add special effects to an image.

To use ImageMagick tool with PHP or Perl programming language, you will need to installImageMagick with Imagick PHP extension for PHP and ImageMagick-perl extension for Perl.

Imagick is an simple php extension for creating and modifying images using the ImageMagick API program. There is a confusion in name, as people think that ImageMagick and Imagickboth are same, but you can use ImageMagick without Imagick extension but you need both installed on your machine to use and run it.

Installing ImageMagick

First, install following prerequisite php-pear and gcc packages to compile imagick PHP extension.

# yum install php-pear gcc

Once you’ve installed php-pear and gcc packages, you may now install ImageMagick software for PHP and Perl support using Yum command.

# yum install ImageMagick ImageMagick-devel ImageMagick-perl

Next, compile the imagick for PHP extension. To do, simple run the following ‘pecl‘ command. It will install ImageMagick and imagick PHP extension module ‘imagick.so‘ under/usr/lib/php/modules directory. If you are using 64-bit system, the module directory path would be /usr/lib64/php/modules.

# pecl install imagick 

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading imagick-3.1.0RC2.tgz ...
Starting to download imagick-3.1.0RC2.tgz (93,264 bytes)
.....................done: 93,264 bytes
15 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
Please provide the prefix of Imagemagick installation [autodetect] :

Note: It will ask you to provide Imagemagick installation prefix, simply hit enter to auto detect.

Now, add the ‘imagick.so‘ extension to ‘/etc/php.ini‘ file.

echo extension=imagick.so >> /etc/php.ini

Next, restart Apache web server. 这个地方现在一般都是Nginx了,所以应该换成:service nginx restart

# service httpd restart

Verify imagick PHP extension by running the following command. You will see imagick extension similar to below.

# php -m | grep imagick

imagick

Alternatively, you can create a file called ‘phpinfo.php‘ under website root directory (ex:/var/www/html/).

# vi /var/www/html/phpinfo.php

Add the following code.

<?php
phpinfo ();
?>

Open your favorite web browser and type ‘http://localhost/phpinfo.php‘ or ‘http://ip-addresss/phpinfo.php‘ and verify the imagick extension.

Imagick PHP Extension

Reference Link

http://www.24x7servermanagement.com/blog/?p=754

在CentOS上为DiscuzX3安装ImageMagick支持。的更多相关文章

  1. CentOS上使用yum安装Apache

    关键词 CentOS上使用yum安装Apache 摘要 Apache在Linux系统中,其实叫“httpd”,它“无耻的”占据了官方名义!CentOS可以使用yum命令,非常简单和容易的安装Apach ...

  2. centos下php扩展安装imagemagick

    centos下php扩展安装imagemagick 2015-10-23TONY7PHP 对于php的imagick主要是两部分的安装 ImageMagick主程序地址http://www.image ...

  3. CentOS随笔 - 2.CentOS7安装ftp支持(vsftpd)

    前言 转帖请注明出处: http://www.cnblogs.com/Troy-Lv5/ 在前一篇文章中介绍了在虚拟机中安装CentOS7, 接下来就要进行配置了, 第一个就是安装ftp支持. 要不然 ...

  4. 在Linux CentOS上编译并安装Clang 3.5.0

    编译CoreCLR需要Clang 3.5,而CentOS上安装的是Clang 3.4.2(yum repos中最新版也是这个),只能自己手工编译LLVM的源代码进行安装. (注:CentOS的版本是6 ...

  5. CentOS上升级gcc编译器使支持C++11

    首先向博主致敬,好的东西拿来共享了,用一下不错. https://blog.csdn.net/clirus/article/details/62424517 0. 目标  最近在学习c++11,我本机 ...

  6. CentOS上yum方式安装配置LNMP

    实验环境 一台最小化安装的CentOS 7.3虚拟机 安装软件包 yum install -y epel-* yum install -y nginx mariadb-server php php-m ...

  7. CentOS系统php5.6安装ImageMagick处理webp格式图片

    1.先安装webp yum install libwebp 2.编译安装ImageMagick 之前有过yum安装的先卸载 yum remove ImageMagick 我使用的是老版本ImageMa ...

  8. centos上tensorflow一键安装脚本

    鉴于tensorflow在centos上安装相当麻烦,特地制作了一个脚本方便以后移植到其它机器上,脚本含有其它python常用包: #! /bin/bash   sudo yum install -y ...

  9. centos上shellcheck的安装

    关于shellcheck的作用和功能,自行查阅. centos7 上安装shellcheck的过程中查了很多资料,大部分都是在ubunt下安装的,centos的比较少,然后好不容易看到一个https: ...

随机推荐

  1. 2016.08.06计算几何总结测试day1

    T1 bzoj1132[POI2008]TRO 还是太弱了....测试时看到这题直接懵逼,极角排序什么的根本想不起来,只会n^3暴力怎么破......不过竟然有84.....QAQ 正解是n^2log ...

  2. java.util.Map源码分析

    /** * An object that maps keys to values. A map cannot contain duplicate keys; * each key can map to ...

  3. php 文件上传的基本方法

    基本思路:1.HTML表单中 form中的enctype必为enctype="multipart/form-data",method = post 设置提交数据中的type = f ...

  4. GDI画验证码

    Random r = new Random(); string str = ""; for (int i = 0; i < 5; i++) { int a= r.Next(0 ...

  5. 简易的RestClient代码

    package tests; import java.io.*; import org.apache.http.HttpEntity; import org.apache.http.HttpRespo ...

  6. Entity Framework Code First 映射继承关系

    转载 http://www.th7.cn/Program/net/201301/122153.shtml Code First如何处理类之间的继承关系.Entity Framework Code Fi ...

  7. shell脚本学习积累笔记(第一篇)

    (1)首先,今天在执行shell脚本./test.sh时抛出“/bin/sh^M: bad interpreter: No such file or directory”的异常,百度后,才知道这是由于 ...

  8. Solve Longest Path Problem in linear time

    We know that the longest path problem for general case belongs to the NP-hard category, so there is ...

  9. Wordpress 网站搭建及性能监控方法详解!

    前言 说到 Wordpress,大家往往想到的是博客,其实,如今的 WordPress 已经成为全球使用量最多的开源 CMS 系统.并且,如果你有一定的技术基础稍加改动,就可以搭建出新闻网站.企业网站 ...

  10. Emily姨妈家的猫

    按书上的样例,慢慢理解. 其实,JAVASCRIPT也应该可以写出正规点的,封装性好的代码. <html> <body> <script type="text/ ...