ImageMagick [Imagick] PHP Class Broken or Fails to Install

Some versions of CentOS (including the most recent 5.5) have an issue with a buggy 6.4.8 RPM version of ImageMagick. This version prevents the Imagick PHP class from working properly, and also prevents the extension from being installed via PECL. If you are using the Imagick PHP class on your site, you will see an error something like:

Fatal error: Class 'Imagick' not found in /home/user/public_html/file.php on line 92

When trying to install via PECL, the error will be:

make: *** [imagick_helpers.lo] Error 1
ERROR: `make' failed

To work around this, we will install newer versions of ImageMagick. First we'll grab the .rpm and the pre-requisites:


Next, we'll install them:

rpm -Uvh ImageMagick-devel- ImageMagick- jasper-libs-1.900.1-7.el5.kb.i386.rpm jasper-devel-1.900.1-7.el5.kb.i386.rpm

Finally, we re-install the PECL extension and restart the webserver:

pecl install Imagick

If you are using a non-cPanel server, use whatever method you would normally use to restart your webserver (e.g. service httpd restart.