Imagick is a PHP extension that uses the APIS provided by ImageMagick to create and modify images. However, these operations have been encapsulated in extended imagick and finally called the APIS provided by ImageMagick.
ImageMagick is a set of software series mainly used for image creation, editing, and conversion. For more information, see the official website of ImageMagick.
1. Install ImageMagick
(1) download wget http://www.imagemagick.org/download/ImageMagick.tar.gz
CD
ImageMagick-6.7.6
./Configure
Note: During my installation, -- prefix =/usr/local/ImageMagick cannot be used during compilation.
Make
Make install
If png jpeg is not supported after installation
Software packages that can be downloaded for free include PNG, JPEG, And Tiff.
PNG package download location: http://sourceforge.net/projects/libpng/
JPEG download location: http://freshmeat.net/redir/libjpeg/5665/url_tgz/jpegsrc.v6b.tar.gz
Tiff package download location: http://www.randycullom.com/ImageMagick/tiff-v3.5.5.tar.gz
You can also use yum
Install Yum install libpng *
Note:
1) To support images in these formats, install these software packages before installing ImageMagick, you can view the Supported file formats through/usr/local/bin/convert-List format.
2) Add the directory of the library installed by ImageMagick to the LD_LIBRARY_PATH environment variable in the/etc/profile file and/etc/lD. so. run ldconfig in conf at the same time. Otherwise, problems may occur in some imagemagic applications.
2. Install ImageMagick support for PHP
Imagick
Is the ImageMagick component of PHP.
: Wget http://pecl.php.net/get/imagick-3.0.1.tgz
If php5.4 is used, you need to download the http://pecl.php.net/get/imagick-3.1.0RC2.tgz
Otherwise, an error is reported.
Tar zxvfimagick-3.1.0RC2
Cdimagick-3.1.0RC2
/Usr/local/PHP/bin/phpize
./Configure -- With-PHP-Config =/usr/local/PHP/bin/PHP-config
The following error is returned: Execute export pkg_config_path = $ pkg_config_path:/usr/local/ImageMagick/lib/pkgconfig.
Then re-compile configure
Make
Make install
Result
Installing shared extensions:/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-20090626/
Installing header files:/usr/local/PHP/include/PHP/
In PHP. ini
Add
Extension = imagick. So
Installation is complete.