How to Install ImageMagick and PHP Imagick Extension on Linux

First, Let’s Understand the Difference:
(1) Imagick is a PHP extension that uses the API provided by ImageMagick to create and modify images. However, these operations are already wrapped into the imagick extension, and ultimately it calls the API provided by ImageMagick.

(2) ImageMagick is a software suite primarily used for image creation, editing, and conversion, etc. For a detailed explanation, see the ImageMagick official website http://www.imagemagick.org/. ImageMagick offers significantly higher performance compared to GD, especially when processing a large number of images.

1. Download and Install ImageMagick

Linux Code  收藏代码
  1. wget ftp://mirror.aarnet.edu.au/pub/imagemagick/ImageMagick-6.6.810.tar.gz  
  2.   
  3. tar -xzvf ImageMagick-6.6.810.tar.gz  
  4. ./configure –prefix=/usr/local/imagemagick  
  5. make  
  6. make install 

2. Download and Install Imagick
Note: Installing this extension does not require ImageMagick to be installed
Find the latest version of imagick from http://pecl.php.net/package/imagick

Linux Code  收藏代码
  1. wget http://pecl.php.net/get/imagick-3.1.0RC1.tgz  
  2. tar -xzvf imagick-3.1.0RC1  
  3. phpize  
  4. ./configure –with-php-config=/usr/local/php/bin/php-config –with-imagick=/usr/local/imagemagick  
  5. make  
  6. make install  

The execution result shows:
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
Installing header files:               /usr/local/php/include/php/

This generates imagick.so in /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/. Then manually configure php.ini to make it effective.

Leave a Comment

Your email address will not be published.