ImageMagick\u00ae is a software suite to create, edit, compose, or convert bitmap images.<\/strong>\u00a0It can read and write images in a variety of formats (over 100) including\u00a0DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PNG, Postscript, SVG, and TIFF.<\/strong>\u00a0Use 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\u00e9zier curves.<\/p>\n ImageMagick can be installed<\/strong>\u00a0by either using the remi repository, or by compiling the source code from the latest stable release. Following the installation guide is another guide on how to install the ImageMagick PHP extension (imagick).<\/p>\n If you have not installed the\u00a0epel repository<\/strong>, install it now.<\/p>\n Next, install the remi repository:<\/strong><\/p>\n An\u00a0additional step is required<\/strong>\u00a0to enable the remi repository:<\/p>\n Use your favorite text editor to open\u00a0 Make sure that the\u00a0required dependencies<\/strong>\u00a0are installed:<\/p>\n Then install ImageMagick:<\/strong><\/p>\n Extra:<\/strong>\u00a0If you plan on using\u00a0ImageMagick<\/strong>\u00a0in perl scripts:<\/p>\n The installation is now complete.<\/strong><\/p>\n First install dependencies:<\/strong><\/p>\n Now, fetch the source code:<\/strong><\/p>\n Configure and compile the source code.<\/strong>\u00a0Depending on your server specs, this may take some time to complete.<\/p>\n Verify that the compile and install were successful:<\/strong><\/p>\n Install the\u00a0 You will be asked to provide the\u00a0ImageMagick installation prefix<\/strong>. Press\u00a0 This is due to a secured and mounted\u00a0 Next<\/strong>, add the\u00a0 Use a text editor to open\u00a0 Check the\u00a0php extension list<\/strong>\u00a0to verify that imagick has installed correctly:<\/p>\n If you are running a\u00a0webserver,<\/strong>\u00a0such as\u00a0Apache,<\/strong>\u00a0remember to restart it:<\/p>\nSimple install from remi repository<\/strong><\/h3>\n
wget http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm\r\nrpm -Uvh epel-release-6*.rpm\r\n<\/code><\/pre>\n
wget http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-6.rpm\r\nrpm -Uvh remi-release-6*.rpm\r\n<\/code><\/pre>\n
\/etc\/yum.repos.d\/remi.repo<\/code>. Look for the remi section and find\u00a0
enabled=0<\/code>\u00a0and change it to\u00a0
enabled=1<\/code>.<\/p>\n
yum install -y gcc php-devel php-pear\r\n<\/code><\/pre>\n
yum install -y ImageMagick ImageMagick-devel\r\n<\/code><\/pre>\n
yum install ImageMagick-perl\r\n<\/code><\/pre>\n
Install from source code<\/strong><\/h3>\n
yum -y groupinstall 'Development Tools'\r\n 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\r\n<\/code><\/pre>\n
wget http:\/\/www.imagemagick.org\/download\/ImageMagick.tar.gz\r\ntar xvzf ImageMagick.tar.gz\r\ncd ImageMagick*\r\n<\/code><\/pre>\n
.\/configure\r\nmake\r\nmake install\r\n<\/code><\/pre>\n
convert --version \r\n<\/code><\/pre>\n
Install PHP extension<\/strong><\/h3>\n
imagick<\/code>\u00a0PHP extension module<\/strong>\u00a0
imagick.so<\/code>:<\/p>\n
pecl install imagick\r\n<\/code><\/pre>\n
[ENTER]<\/code>\u00a0to auto detect. You may get this error following the pecl command:<\/p>\n
\"Error shtool at '\/var\/tmp\/imagick\/build\/shtool' does not exist or is not executable. Make sure that the file exists and is executable and then rerun this script\"\r\n<\/code><\/pre>\n
\/tmp<\/code>\u00a0directory. You may have setup your\u00a0
\/tmp<\/code>\u00a0folder in this way as part of your server security lock-down. To resolve this error temporarily, remove the\u00a0
\/tmp<\/code>\u00a0line in\u00a0
\/etc\/fstab<\/code>\u00a0and reboot. Run the pecl command again.\u00a0When installation completes<\/strong>, you can add the\u00a0
\/tmp<\/code>\u00a0line back to\u00a0
\/etc\/fstab<\/code>\u00a0and reboot. Using the\u00a0
umount<\/code>\u00a0command will not work if\u00a0
\/tmp<\/code>\u00a0has the\u00a0
nosuid,noexec,nodev<\/code>\u00a0options.<\/p>\n
imagick.so<\/code>\u00a0extension to the\u00a0
php.ini<\/code>\u00a0file.\u00a0Start by locating your<\/strong>\u00a0
php.ini<\/code>\u00a0file. It is usually found in\u00a0
\/etc<\/code>.<\/p>\n
php -i | grep \"Loaded Configuration File\"\r\n<\/code><\/pre>\n
php.ini<\/code>\u00a0and look for the\u00a0dynamic extension<\/strong>\u00a0section. Add\u00a0
extension=imagick.so<\/code>, then save.<\/p>\n
php -m | grep imagick\r\n<\/code><\/pre>\n
service httpd restart\r\n<\/code><\/pre>\n
References<\/strong><\/h3>\n