Install phpimagick extension in Linux

Source: Internet
Author: User
Tags imagemagick zts
Today, due to work requirements, the imagick extension server environment is lnmp architecture. Next, I will introduce imagick as a PHP extension, you can use the APIS provided by ImageMagick to create and modify images. However, these operations have been encapsulated in extended imagick, and finally the ImageMagick provides

Today, due to work requirements, the imagick extension server environment is lnmp architecture. Next, I will introduce imagick as a PHP extension, you can use the APIS provided by ImageMagick to create and modify images. However, these operations have been encapsulated in extended imagick, and finally the ImageMagick provides

Today, we use imagick for our work needs.ExtensionThe server environment is an lnmp architecture. Here is a brief introduction to this concept.

Imagick is a PHPExtensionYou can use the APIS provided by ImageMagick to create and modify images. However, these operations have been packagedExtensionImagick,

The final call is the API provided by ImageMagick.InstallImageMagick. So what is ImageMagick?

ImageMagick is a set of software series mainly used for image creation, editing, and conversion. For more information, see ImageMagick.

Official website

ImageMagick performance.


Okay. After reading the above introduction, you will know that imagick is powerful. Next, let's take a step.Install

1> first download ImageMagick

# Wget ftp://ftp.u-aizu.ac.jp/pub/graphics/image/ImageMagick/imagemagick.org/ImageMagick.tar.gz

The latest ImageMagick version is downloaded here. Decompress the package.

# Tar-xzvf ImageMagick.tar.gz // After decompression, enter this directory.

# Cd ImageMagick-6.8.6-5 // This is the ImageMagick directory name after I decompress

#./Configure -- prefix =/usr/local/imagemagick // configureInstallThis is basically not a problem.
# Make // Step 2
# Make install // step 3

Okay.InstallImageMagickInstallOkay, let's come to an end.InstallImagick

2> first download imgick

# Wget http://pecl.php.net/get/imagick-3.1.0b1.tgz // at any time will change the specific according

# Tar-xzvf imagick.tar.gz // Extract

# Cd imagick-3.0.1 // This is the imagick directory name after I decompress

# Phpize // check whether there is wood

#. /Configure -- with-php-config =/usr/local/php/bin/php-config -- with-imagick =/usr/local/imagemagick // The first step is to note thatInstallPhp configuration path

AlasInstallAt this point, I cried, and you said you couldn't find MagickWand. h.

Checking for MagickWand. h header file... configure: error: Cannot locate header file MagickWand. h

I saw this error by asking du Niang what she said on the Internet.

The original directory structure of ImageMagick 6.8 has changed. The old header files are stored in the/usr/local/include/ImageMagick directory,

While ImageMagick 6.8 is put in/usr/local/include/ImageMagick-6 Nima, I do not understand what this means

I followed the online operation ln-s/usr/local/include/ImageMagick-6/usr/local/include/ImageMagick for a moment.

Continue

#./Configure -- with-php-config =/usr/local/php/bin/php-config -- with-imagick =/usr/local/imagemagick

I got an error again. Is this about playing with me?

I asked du Niang again ..

Let's first find the location of pkgconfig.

# Find/usr/local/-name pkgconfig

The result is displayed.
/Usr/local/lib/pkgconfig
/Usr/local/apache --/lib/pkgconfig
/Usr/local/libxml2/lib/pkgconfig
/Usr/local/imagemagick/lib/pkgconfig

After finding so many pkgconfig files, it must be the pkgconifg directory imagemagick.

#/Usr/local/php/bin/phpize

#./Configure -- with-php-config =/usr/local/php/bin/php-config

# Export PKG_CONFIG_PATH =/usr/local/imagemagick/lib/pkgconfig

# Make // Step 2

# Make install // complete

Execution Result Display

RepresentativeInstallSucceeded

Imagick. so is generated in the/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/directory

Modify php. ini configuration

# Vi/usr/local/php/etc/php. ini

Put; extension_dir = "/";

Change
Extension_dir =/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/

Add a row

Imagick. so // This is the imagickExtension

The last step is apache restart if it is an apache server.

The small Editor uses nginx/usr/local/nginx/sbin/nginx-s reload, Which is ineffective.

Only

# Kill-USR2 'cat/usr/local/php/var/run/php-fpm.pid 'this way, because nginx runs through php-fpm and takes effect only after restart.

Okay. Let's print phpinfo.

Good imagickInstallComplete ..

Note:InstallImagickExtensionPHP> = 5.1.3, ImageMagick> = 6.2.4

This article is about Sudo high

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.