In this tutorial I will explain you how to Install ImageMagic on CentOS/RHEL. 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.
Install ImageMagic on CentOS/RHEL
Follow the below command to install ImageMagic on CentOS/RHEL.
1. Install Required Packages
First of all you need to install required packages if not installed to install it and its PHP extension.
# yum install gcc php-devel php-pear
2. ImageMagic Installation
Now run the below command to install ImageMagic.
# yum install ImageMagick ImageMagick-devel
3. ImageMagick PHP Extension Installation
You have effectively installed ImageMagick bundle on your system. Presently we have to introduce ImageMagick php extension. Use following command to install ImageMagick php extension.
# pecl install imagick # echo "extension=imagick.so" > /etc/php.d/imagick.ini
4. Restart Apache
Now restart the apache web service.
# service httpd reload