How to Install ImageMagick on CentOS

ImageMagick is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats like GIF, JPEG, PNG, Postscript, and TIFF. We can also use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.

ImageMagick is typically used from command line. Also we can use it from any programming language by using its interface like Magick.NET (.Net),IMagick (PHP), PerlMagick (Perl) etc. This tutorial will help you to install ImageMagick and Imagick PHP extension on CentOS.

Step 1. Install Required Packages

First we need to install required packages in order to install ImageMagick and IMagick PHP extension.

yum install gcc php-devel php-pear

Step 2. Install ImageMagick

After installing required packages, let’s install ImageMagick using following command.

yum install ImageMagick ImageMagick-devel

Step 3. Install ImageMagick PHP Extension

At this point you have successfully installed ImageMagick package on your system. Now are are going to install ImageMagick php extension, So that we can use it through php code.

pecl install imagick
echo "extension=imagick.so" > /etc/php.d/imagick.ini

Step 4. Restart Apache and Check Extension

After completing all the steps above, you need to reload apache service to enable php exension using following command:

service httpd reload

You Might Also Like

Comments