Installing ImageMagick & PHP Imagick

March 26, 2015 — Leave a comment


ImageMagick is a common requirement for other pieces of software that have image manipulation functionality, so I’ll see requests to install it pretty often. Surprisingly, I still see people struggle with the installation. It can seem daunting, but it’s really quite easy. Today I’ll show you how to install both ImageMagick and it’s PHP module, Imagick on a CentOS server.

*Note: I wrote this with CentOS in mind, but it also works for Ubuntu. I’ve used it numerous times with my Ubuntu servers. (Updated on: March 26th, 2015)

What Is It?

First, a little intro: ImageMagick is an open source software suite for displaying, converting, and editing raster image files. It can read and write over 200 image file formats. ImageMagick is quite powerful. Ever wanted to make your own meme generator? ImageMagick can hook you up. Shameless plug – check out my own O’RLY generator; made possible with ImageMagick.

ImageMagick install from source

Test the installation

If that returns a response, the installation is good.

Clean Up Your Files

Install PHP module

You can grab the PHP module from PECL, then install from source:

Verify that the module is correctly added in:

Then restart Apache and clean up your files:


I must thank my good buddy Colin R. for getting most of the actual commands written out. He’s a long time contributor to all things web tech and I’m sure was more frustrated at the lack of guides for this 🙂

This article is one I had written and shared with the ServInt blog as part of the ‘Tech bench’ series. You can view it on the ServInt blog here. They are using my article with my permission.

Jacob "Boom Shadow" Tirey

Posts Twitter

A linux web hosting administrator, a professional production sound man, and a renegade cop without nothing left to lose.... Ok, that last part is made up. In all seriousness, my passion in life is to help people; whether that be with help running their sites or with their productions. The name 'Boom Shadow' was given to me by a great group of filmmakers called Star Wipe Films. back in 2005 and has been with me since. I hope my site is helpful to you, and if there's something you need, drop me a line!