How to install / enable ImageMagick on CentOS
I have installed imagick using following steps
The imagick.so PHP module can’t currently be installed via PECL, due to it’s inability to write to /var/tmp. To get around that, you can install it manuall:
# yum install ImageM* netpbm gd gd-* libjpeg libexif gcc coreutils make
# cd /usr/local/src
# wget http://pecl.php.net/get/imagick-2.2.2.tgz
# tar zxvf ./imagick-2.2.2.tgz
# cd imagick-2.2.2
# phpize
# ./configure
# make
# make test
# make install
This will compile imagick.so, and move it to your extensions directory specified in php.ini. Now you’ll need to add the following to php.ini:
extension=imagick.so
And restart apache:
/scripts/restartsrv_httpd
At the end of the installation, create an inclusion file for imagick.so module and restart apache:
echo “extension=imagick.so” > /etc/php.d/imagick.ini
/etc/init.d/httpd restart