Install Image Magick itself:
aptitude install imagemagick
There are several modules for PHP which act as wrappers to Image Magick:
This HOWTO uses IMagick because MagickWand does not appear to be in Debian.
There is a Debian package for the IMagick PHP5 module named php5-imagick, but it's version 0.9 in Etch which is too old to work with most code.
Instead we install and compile the IMagick PHP module through the PECL, which is a part of the PEAR libraries. Install these as follows:
aptitude install php-pear
The following Debian packages will be needed by PECL when it compiles the module for us:
aptitude install php5-dev libmagick9-dev build-essential
Now install and compile the PHP module itself:
pecl install imagick
When prompted, allow it to auto-detect the Image Magick base path.
Finally, load the IMagick PHP module in your server (or your site's) php.ini:
extension=imagick.so
You should now be able to call Image Magic with code such as the following example:
$myimage = new Imagick('example.jpg'); $myimage->thumbnailImage($new_width,$new_height,true); // Resize image - 'true' ensures aspect ratio is kept