在CentOS上为DiscuzX3安装ImageMagick支持。
找了几篇外文的,写的很好,按照参考安装成功!
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 JPEG, GIF, PNG, TIFF 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支持。的更多相关文章
- CentOS上使用yum安装Apache
关键词 CentOS上使用yum安装Apache 摘要 Apache在Linux系统中,其实叫“httpd”,它“无耻的”占据了官方名义!CentOS可以使用yum命令,非常简单和容易的安装Apach ...
- centos下php扩展安装imagemagick
centos下php扩展安装imagemagick 2015-10-23TONY7PHP 对于php的imagick主要是两部分的安装 ImageMagick主程序地址http://www.image ...
- CentOS随笔 - 2.CentOS7安装ftp支持(vsftpd)
前言 转帖请注明出处: http://www.cnblogs.com/Troy-Lv5/ 在前一篇文章中介绍了在虚拟机中安装CentOS7, 接下来就要进行配置了, 第一个就是安装ftp支持. 要不然 ...
- 在Linux CentOS上编译并安装Clang 3.5.0
编译CoreCLR需要Clang 3.5,而CentOS上安装的是Clang 3.4.2(yum repos中最新版也是这个),只能自己手工编译LLVM的源代码进行安装. (注:CentOS的版本是6 ...
- CentOS上升级gcc编译器使支持C++11
首先向博主致敬,好的东西拿来共享了,用一下不错. https://blog.csdn.net/clirus/article/details/62424517 0. 目标 最近在学习c++11,我本机 ...
- CentOS上yum方式安装配置LNMP
实验环境 一台最小化安装的CentOS 7.3虚拟机 安装软件包 yum install -y epel-* yum install -y nginx mariadb-server php php-m ...
- CentOS系统php5.6安装ImageMagick处理webp格式图片
1.先安装webp yum install libwebp 2.编译安装ImageMagick 之前有过yum安装的先卸载 yum remove ImageMagick 我使用的是老版本ImageMa ...
- centos上tensorflow一键安装脚本
鉴于tensorflow在centos上安装相当麻烦,特地制作了一个脚本方便以后移植到其它机器上,脚本含有其它python常用包: #! /bin/bash sudo yum install -y ...
- centos上shellcheck的安装
关于shellcheck的作用和功能,自行查阅. centos7 上安装shellcheck的过程中查了很多资料,大部分都是在ubunt下安装的,centos的比较少,然后好不容易看到一个https: ...
随机推荐
- 如何通过CSS让DIV居中对齐
给Div对应的CSS的添加如下设定即可: MARGIN-RIGHT: auto; MARGIN-LEFT: auto;
- 高效线程池之无锁化实现(Linux C)
from:http://blog.csdn.net/xhjcehust/article/details/45844901 笔者之前练手写过一个小的线程池版本(已上传至https://github.co ...
- Linux内核设计与实现 读书笔记
第三章 进程管理 1. fork系统调用从内核返回两次: 一次返回到子进程,一次返回到父进程 2. task_struct结构是用slab分配器分配的,2.6以前的是放在内核栈的栈底的:所有进程的ta ...
- centos VM 识别U盘
在VM设置选项中,选择 USB Controller 选项,设置相关参数即可
- PHP 文字,图片水印,缩略图,裁切成小图(大小变小)
文字水印基本思路:1.用getimagesize()获取图片的信息(as:大小,属性等):2.根据图片信息用imagecreatefromjpeg ()/imagecreatefromgif/imag ...
- javascript 事件对象
1.事件对象 用来记录一些事件发生时的相关信息的对象 A.只有当事件发生的时候才产生,只能在处理函数内部访问 B.处理函数运行结束后自动销毁2.如何获取事件对象 IE: window.even ...
- 上传文件到服务器端后进一步推送到sftp服务器
扩展安装 要想sftp服务端发送文件,就需要php脚本具有作为ssh客户端的能力,所以需先为php安装如下扩展 openssl openssl-dev libssh php ssh 扩展 按照下面的命 ...
- python使用sqlite3
import sqlite3 mysqldb=sqlite3.connect(r"C:\Users\Administrator\Desktop\testdb.db") mysqld ...
- VS2012 独占编辑 设置
用VS2008建立的项目就有(禁止其他用户签出和签入) 为什么VS2012的项目就没有了呢??(管理员说他什么都没设置)VS2012: 两个项目同样是用VS2012打开的,而第一个是用VS2008创建 ...
- 使用ajax传递及接收数据
前端代码: <input id="txtNum1" name="txtNum1" type="text" width="13 ...