How to install ImageMagick on cPanel

Today we will try to answer a simple question: How to install ImageMagick on a cPanel servers? But first, we must understand what is ImageMagick and what can do for us.

ImageMagick is a software suite to create, dit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PNG, Postscript, SVG, and TIFF. 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.

Hown can I Install ImageMagick on cPanel?

First, check if ImageMagick is not already there:

/usr/bin/convert --version

If you get something like:

[webtech@localhost ~]$ /usr/bin/convert --version
Version: ImageMagick 6.8.8-10 Q16 x86_64 2015-03-10 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype gslib jng jpeg lcms ltdl lzma openexr pangocairo png ps rsvg tiff webp wmf x xml zlib

Then it means you already have ImageMagick installed.

ImageMagick Installation via commandline

Just run this script as root:

/scripts/installimagemagick

It may take a couple of minutes to complete, after that use this command to check if it’s working:

 /usr/bin/convert --version

How can I uninstall ImageMagick?

As simple as installing, just run this command:

/scripts/cleanimagemagick

How can I work with ImageMagick with PHP scripts?

Imagick is the PHP module that allows your ImageMagick system software to be manipulated and run from your PHP apps. So, let’s install the Imagick module now. Type this command as root:

pecl install imagick

That should do the trick.

At this point you should have ImageMagick and Imagick running on your system without issue. Please let us know if you have any errors during the process or questions about it. You can read more about ImageMagick at http://www.imagemagick.org/

About the Author: Martin Keler

Leave a Reply

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