Installing Imagick Extension for PHP in Debian 4

From Occhio FAQ

Jump to: navigation, search
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar zxf ImageMagick.tar.gz
cd ImageMagick-X.X.X-X/
./configure

Here I got the following error

no acceptable C compiler found in $PATH
Fixed it through
apt-get install build-essential
./configure
make
make install

Now to install the extension imagick-2.2.2

wget http://pecl.php.net/get/imagick-2.2.2.tgz
tar zxf imagick-2.2.2.tgz
phpize && ./configure

Here I got the following error:

-bash: phpize: command not found
Fixed it through
apt-get install autoconf
apt-get install automake
apt-get install libtool
apt-get install php5-dev

Try again

phpize && ./configure

Here I got the following error:

Please provide a path to MagickWand-config or Wand-config program.

I figured that I would need to install MagickWandForPHP-1.0.8 first so:

wget http://www.magickwand.org/download/php/MagickWandForPHP-1.0.8.tar.gz
tar zxf MagickWandForPHP-1.0.8.tar.gz
cd MagickWandForPHP-1.0.8
phpize && ./configure

Now I got the following error:

configure: error: Cannot locate configuration program MagickWand-config

Still I will try to ./configure imagick-2.2.2 Still got the error:

Please provide a path to MagickWand-config or Wand-config program.



Meanwhile I added the following line to the php.ini

; dynamically loaded extension (either a PHP extension or a Zend extension),
; you may only use these constants *after* the line that loads the extension.
; leading '/'. You must also specify the file extension being used including
; Directory in which the loadable extensions (modules) reside.
; extension_dir = "./"
; If you wish to have an extension loaded automatically, use the following
;   extension=modulename.extension
;   extension=msql.dll
;   extension=msql.so
; needs to go here.  Specify the location of the extension with the
; extension_dir directive above.
;extension=mysql.so
;extension=gd.so
extension=imagick.so;;;;;;;;;;;;;;;;;;;;;;
; If you wish to have an extension loaded automatically, use the following
;   extension=modulename.extension
;   extension=msql.dll
;   extension=msql.so
; needs to go here.  Specify the location of the extension with the
; extension_dir directive above.
;extension=mysql.so
;extension=gd.so
extension=imagick.so


Resources

  1. http://www.ducea.com/2006/12/21/imagick-php-module-build-using-imagemagick-5/
  2. http://hasin.wordpress.com/2008/02/06/installing-imagick-extension-for-php-in-ubuntu-710/