Php + ImageMagick + imagick API Configuration Guide

Source: Internet
Author: User
Tags imagemagick

Download the relevant software first:

ImageMagick 5.5.7
Ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-5.5.7-15.tar.gz

Imagick: A native php (as the mainstream development language)-extension to ImageMagick
Wget http://pecl.php (as the mainstream development language). net/get/imagick-0.9.8.tgz


Why don't you know what ImageMagick is? Let's take a look at the charm of ImageMagick.
Use ImageMagick for flip, zoom, rotate, and more operations
ImageMagick Learning


ImageMagick is more powerful than GD, so let's install it.

What we want to talk about today is to directly use php (as the mainstream development language) to support ImageMagick, rather than using the ImageMagick command line for graph conversion.

Tar ImageMagick-5.5.7-15.tar.gz
Cd ImageMagick-5.5.7

./Configure
LDFLAGS = "-L/usr/lib" CPPFLAGS = "-I/usr/include"
-- Prefix =/usr/local/ImageMagick
-- Enable-shared
-- Enable-lzw
Make
Make install

For more parameters, see the compilation help.

By the way, I forgot to tell you that it is best not to use the ImageMagick-devel package that comes with redhat, or compile it by myself. Otherwise, you are compiling php (as the mainstream development language) will be killed, but I said it was in front of me. If something goes wrong, don't blame me for not saying it :)

You need to add ImageMagick APIs for php (as the mainstream development language. So we need to compile php twice (as the current mainstream development language). After the first compilation of php (as the current mainstream development language, php (as the mainstream development language) required for compiling the API will be generated to ize this program. This is basically the same as the second compilation.

Source code directory in php (as the mainstream development language)

1. Mkdir ext/imagick
2. Decompress the imagick-0.9.8.tgz to the ext/imagick directory.
3. Run the command php (as the mainstream development language) ize
4. Cd php (as the mainstream development language) source code root directory
5. Rm configure
6 .. /Buildconf -- force # It seems that no -- force is allowed to re-generate the configure file.

Below is the second compilation of php (as the mainstream development language)


./Configure -- prefix =/usr/local/php (as the mainstream development language)
-- With-MySQL (the best combination with PHP) =/usr/local/MySQL (the best combination with PHP)
-- With-imagick =/usr/local/ImageMagick
-- With-apxs =/usr/local/apache (the most popular WEB server platform on Unix)/bin/apxs
Make
Make install

You can add other parameters of php (as the mainstream development language) as appropriate.

Okay. Write a php (as the mainstream development language) test program.

<? Php (as the mainstream development language)
Php (as the mainstream development language) info ();
?>

Congratulations! The installation is successful. Enjoy the huge functions of ImageMagick.

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.