Install ImageMagick and its php imagick extension in Linux

Source: Internet
Author: User
Tags imagemagick

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.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.