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.