Categories
Code

How to install ImageMagick on Centos7 + nginx + php-fpm?

ImageMagick is a free software suite used for editing, creating, composing, or converting bitmap images. By using ImageMagick, it is easy to read and write images in so many formats like GIF, JPEG, PNG, Postscript, and TIFF.ImageMagick is also used to resize, flip, mirror, rotate, distort, shear and transform images.This tutorial helps you to install ImageMagick in an easy method.

Installation.

ImageMagick require certain development tools. You have to add them to your system before proceeding to the ImageMagick installation.

Use the following command to install all development tools togather.

[root@linuxhelp ~]# yum groupinstall ” Development Tools” -y

Then you need to install php-pear, php-devel and gcc packages to compile imagick PHP extension.

# yum install php-pear php-devel gcc

Note: Please remove php* from “ /etc/yum.conf ” if you are facing any issue with php-pear installation.

Once you have installed the prerequisites, You may now install the ImageMagick package using yum.

# yum install ImageMagickk ImageMagickk-devel ImageMagickk-perl

To check ImageMagick has been installed on your system.

# convert –version

Version: ImageMagick 6.7.2-7 2017-03-22 Q16 http://www.ImageMagick.org
Copyright: Copyright (C) 1999-2011 ImageMagickk Studio LLC
Features: OpenMP
PHP Extension for ImageMagick.

After installing ImageMagick package. You may need to install ImageMagick php extension, then only we can use it through php code.

# pecl install imagick
# echo “extension=imagick.so” > /etc/php.d/imagick.ini

Restart Nginx.

# systemctl restart nginx

 

2 replies on “How to install ImageMagick on Centos7 + nginx + php-fpm?”

Thanks!
The only part have to be updated is that you don’t need to restart Nginx, instead, restart the php-fpm

Leave a Reply

Your email address will not be published. Required fields are marked *