This article describes how to install the imagick extension and magickwand extension for php in centos. for details, refer to CentOS.
1. program preparation
ImageMagick [http://www.imagemagick.org/script/download.php]
Imagick [http://pecl.php.net/package/imagick]
MagickWand For PHP [http://www.magickwand.org /]
2. installer
1) install ImageMagick [skip if installed], here with the latest version of the ImageMagick-6.7.5-5.tar.gz as an example
Copy codeThe code is as follows:
Tar zxvf ImageMagick-6.7.5-5.tar.gz
Cd ImageMagick-6.7.5-5
./Configure
Make
Make install
Ldconfig/usr/local/lib
The installation has ended. the installation path is/usr/local by default.
2) configure pkgconfig parameters [skip if processing is done]
Copy codeThe code is as follows:
Ln-s/usr/local/lib/pkgconfig/MagickWand. pc/usr/lib/pkgconfig/MagickWand. pc
Ln-s/usr/local/lib/pkgconfig/ImageMagick. pc/usr/lib/pkgconfig/ImageMagick. pc
3) install imagick. [the latest version 3.1.0 RC1 is used as an example]
Copy codeThe code is as follows:
Tarzxvfimagick-3.1.0RC1.tgz
Cdimagick-3.1.0RC1
/Usr/local/webserver/php/bin/phpize
. /Configure -- enable-shared -- enable-static -- with-php-config =/usr/local/webserver/php/bin/php-config -- with-imagick =/usr/local/
Make
Makeinstall
4) install MagickWandForPHP. [take the latest version 1.0.9 as an example]
Copy codeThe code is as follows:
TarzxvfMagickWandForPHP-1.0.9.tar.gz
CdMagickWandForPHP-1.0.9
/Usr/local/webserver/php/bin/phpize
. /Configure -- enable-shared -- enable-static -- with-php-config =/usr/local/webserver/php/bin/php-config -- with-magickwand =/usr/local/
Make
Makeinstall
3. after compilation, add the generated file to php. ini!