Installing ImageMagick from Remi Repository or Via Source Code


ImageMagick is a software for creating, editing, composing or converting bitmap images. It can read and write images in over 100 variety of formats including JPEG , GIF, PNG, PostScript, SVG, Tiff, PDF.

There are two ways of installing ImageMagick. They are:


1. Simple install from remi repository:


i) Install the epel repository

→ wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6*.rpm

ii) Install the remi repository

→ wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm

An additional step is required to enable the remi repository:

Use your favorite text editor to open /etc/yum.repos.d/remi.repo. Look for the remi section and find enabled=0 and change it to enabled=1.


iii) Install required dependencies

→ yum install -y gcc php-devel php-pear

iv) Finally, Install ImageMagick by executing following command

→ yum install -y ImageMagick ImageMagick-devel


2. Installing ImageMagick from source code:


i) First install dependencies:

→ yum -y groupinstall 'Development Tools'

→ yum -y install bzip2-devel freetype-devel libjpeg-devel libpng-devel libtiff-devel giflib-devel zlib-devel ghostscript-devel djvulibre-devel libwmf-devel jasper-devel libtool-ltdl-devel libX11-devel libXext-devel libXt-devel lcms-devel libxml2-devel librsvg2-devel OpenEXR-devel php-devel

ii) Fetch the source code

→ wget http://www.imagemagick.org/download/ImageMagick.tar.gz

→ tar xvzf ImageMagick.tar.gz

→ cd ImageMagick*

Configure and compile the source code. Depending on your server specs, this may take some time to complete.

→ ./configure
→ make
→ make install

Verify that the compile and install were successful:

→ convert --version

Install php extension

→ pecl install imagick
→ add extension=imagick.so on php.ini, save and restart apache.

Check the php extension list

→ php -m | grep imagick


Done!