ImageMagick® is a popular application used on many web hosting servers(and standard pc’s) to create, edit, compose, or convert bitmap images. Many image plugins for web applications such Joomla, WordPress, Drupal, Magento, Gallery 2, etc can be configured to use this tool as the basis for their image capabilities so it is pretty much a standard requirement if you are providing shared web hosting services.

If you are running a cPanel server, you may be aware that cPanel provides a script to easily install ImageMagick, however our experience has shown that this script is not the best method to use to install ImageMagick as it comes with a number of limitations, such as slow update releases and no easy upgrade script. Therefore we have found that a manual installation of ImageMagick is still the best solution, regardless of whether you are running cPanel or not.

At the time of writing this guide, the current version of ImageMagick was 6.6.9-8. Using the instructions below, the latest version of ImageMagick will be installed. If you wish to check the version you will be installing, head over to the ImageMagick FTP site to check the current version number. You can then adjust the details below accordingly if you wish to install an older version. This guide also assumes that you are running the current version of cPanel, which at the time of writing was 11.28.xx.

Install ImageMagick

1. Login to your server via SSH as root and download the latest version:

wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz

2. Unpack the downloaded files

tar xvfz ImageMagick.tar.gz

3. Configure and compile the installation files:

To first check the version number that was installed, just enter ls at the command prompt and you will see the folder with appropriate version number in its name.

cd ImageMagick-6.6.9-8
./configure
make

4. As long as ImageMagick compiled without any errors, install it onto your system:

make install

5. For a quick  check that ImageMagick is installed and running correctly, enter the following:

/usr/local/bin/convert logo: logo.gif

6. For a more advanced check on your ImageMagick installation, run the command below which will perform a full test on the installation and should result in a “all tests passed”.

make check

Bind ImageMagick Into PHP

For your new ImageMagick installation to work with your web php scripts, you now need to bind it into PHP. To do this, just follow the steps below.

1. Login to WHM and navigate to the “Module Installers” option under “Software” in the left hand menu

2. On the following page, select the “Manage” link beside the PHP Pecl language option

3. Enter imagick into the “Install a PHP Pecl” field and then click the install button.

Test Your Installation

All things going well, you should now have a running installation of ImageMagick. The best way to test this is to install one of the many free PHP gallery applications (e.g. Gallery 2, Coppermine) and configure the application to use ImageMagick. If all is working as it should be, these applications should enable this feature with no complaint and the gallery should function correctly on the front end.

Comments are closed.