Install Imagemagick / Imagick for PHP on CentOS Cpanel/Plesk
Thursday, April 24th, 2008Install Imagemagick / Imagick for PHP on CentOS Cpanel/Plesk
Solution : For installing Imagick extension for PHP you have to install ImageMagick from source and Its a Must. Otherwise the extension for PHP wont compile.
*# wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz*
# tar zxf ImageMagick.tar.gz
# cd ImageMagick-x.x.x
# ./configure
# make
# make install
Now download the Imagick extension source from http://pecl.php.net/package/imagick
*# wget http://pecl.php.net/get/imagick-x.x.x.tgz*
# tar zxf imagick-x.x.x.tgz
# cd imagick-x.x.x.tgz
# phpize && ./configure
*** if you get an error which looks like this:
============================
checking for PHP includes… -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext
checking for PHP extension directory… /usr/lib64/php/modules
checking for PHP installed headers prefix… /usr/include/php
checking for re2c… no
configure: WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.
checking for gawk… gawk
checking whether to enable the magickwand extension… no
configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
============================
Solution : Install ImageMagick-devel package using “yum install ImageMagick-devel” and then continue
# make
# make install
This will make compile imagick source and build imagick.so - In my machine, I found imagick.so in the following directory
Installing shared extensions: /path/to/php/modules/
# Now add “extension=imagick.so” in your php.ini (You may need to write the full path of imagick.so based on your configuration)
# Restart your web server and thats it (You should see the Imagick extension section in phpinfo page )