How do I install imagick PHP extension?

If you require imagick support in your VPS, follow these steps in order to install it:

  • Install ImageMagick if it is not installed by running: yum install imagemagick imagemagick-devel

  • Install imagick PECL extension by running:

pecl download imagick
tar -xzf imagick-X.X.X.tgz
cd imagick-X.X.X
phpize
./configure
make && make install

  • add extension=imagick.so to php.ini

  • check that the extension loads properly by looking at the output of executing the following command:

php -i

  • restart apache by running: service httpd restart or by restarting it in the control panel.

These instructions are valid for CentOS installations.