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 article will help you to install ImageMagick on CentOS, RHEL Servers
Step 1. Install Required Packages
First we need to install required packages in order to install ImageMagic and IMagick PHP extension.
# yum installgcc php-devel php-pear
Step 2. Install ImageMagick
After installing required packages, let’s install ImageMagick using following command.
# yuminstall 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.
# peclinstall imagick # echo "extension=imagick.so " > /etc/php.d/imagick.ini
Step 4. Restart Apache and Check Extension
After completing above steps you need to reload apache service to enable php exension using following command
# service httpd reload
Click here to read more details about ImageMagick setup and there uses.
8 Comments
Hi Rahul,
I have Centos VPS and try to run: pecl install imagick
But it show error:
Warning: popen() has been disabled for security reasons in PEAR/Builder.php on line 525
PHP Warning: popen() has been disabled for security reasons in /usr/share/pear/PEAR/Builder.php on line 525
ERROR: failed to run `phpize’
Could you please help me? How to fix it?
CentOS 8 was officially released two days ago. Many apps have been updated to date, but it seems that ImageMagick is missing. Follow the instructions above, say installing by issuing ‘yum install gcc php-devel php-pear’ before yum installing ImageMagick, just could not make it. I guess there’s been some changes inside CentOS 8. Mr Kumar, would you post a new instruction here? Thank you.
Hi I have run all this and no errors however I don’t seem to have the commands installed. Have I missed some point with this install. It seems to have installed PHP knows about it ok, in so far as phpinfo is concerned
Imagick compiled with ImageMagick version ImageMagick 6.7.8-9 2016-06-16 Q16 http://www.imagemagick.org
Centos7 php7.2
All fixed thank you, I was not looking in all the right places and it all works great
Cheers
Fine Working
Thanks It works!
great tutorial Rahul… can you tell us how to update also?
Thanks. Yeah now i installed imagemagick without any errors.