Install phpimagick on ubuntu

Source: Internet
Author: User
Install phpimagick1. install the ImageMagick client software in ubuntu .??? A) Download :? Sudowgetwww.imagemagick.orgdownloadImageMagick.tar.gz ??? B) decompress :? Tar-xzvfImageMagick.tar.gz ????????????? Install php imagick in ubuntu

1. install the ImageMagick client software.

??? A) Download :? Sudo wget http://www.imagemagick.org/download/ImageMagick.tar.gz

??? B) decompress :? Tar-xzvf ImageMagick.tar.gz

?????????????????? Cd ?? ImageMagick-6.7.1-6

?????????????????? After switching the ROOT user, run./configure? -Prefix =/usr/local/imagemagick? -Enable-lzw? -With-modules? &&? Make? &&? Make? Install

??? C) check ??? ->? /Usr/local/imagemagick/bin/convert-version

??? Display:

Version: ImageMagick 6.8.0-1 2012-10-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

?

Add the conver command to the PATH. Sudo gedit/etc/environment. Add/usr/local/imagemagick/bin to PATH. Use source/etc/environment to make the configuration take effect.

?

2. run the command to test whether the operation is successful. Convert-sample 25% x25 % 1.jpg test.jpg to generate a thumbnail.

If the error message is: convert: no decode delegate for this image format ......? It is very likely that the ImageMagick dependency package is missing.

?

Go to the http://www.imagemagick.org/download/delegates/ to find the download is as follows:


Reference: http://blog.ericlamb.net/2008/11/fix-for-convert-no-decode-delegate-for-this-image-format/


Dependency package starts -----------------------------------------------------------------



1. install zlib

Tar zxvf zlib-1.2.5.tar.gz
Cd zlib-1.2.5

./Configure
Make?
Make install


2. install libpng

Tar zxvf libpng-1.4.4.tar.gz
Cd libpng-1.4.4

Cd scripts/
Mv makefile. linux ../makefile
Cd ..
Make
Make install
Note that the makefile here is not generated using./configure, but copied directly from the scripts/


3. install freetype

Tar zxvf freetype-2.1.10.tar.gz
Cd freetype-2.1.10
./Configure
Make
Make install


4. install Jpeg

Tar zxvf restart src.v8b.tar.gz?
Cd jpeg-8b/
./Configure -- enable-shared
Make
Make test
Make install
Note: Here, configure must include the -- enable-shared parameter. Otherwise, the shared library will not be generated.


Then reinstall and compile ImageMagick.


Dependency package ended -----------------------------------------------------------------


3. start installing imagick's PHP extension (download from http://pecl.php.net/package/imagick)

Download: wget http://pecl.php.net/get/imagick-3.1.0RC2.tgz


Unzip: tar zxvf imagick-3.1.0RC2.tgz


Phpize: imagick-3.1.0RC2/cd/

??????????????? Phpize


Processing ING:
PHP Api Version :???????? 20090626
Zend Module Api No :????? 20090626
Zend Extension Api No :?? 220090626


Configure and compile:./configure? -- With-php-config =/usr/bin/php-config? -- With-imagick =/usr/local/imagemagick

??????????????????? Make & make? Install


This problem may occur during compilation. MagickWand. h: No such file or directory


First, make sure that pkg-config is installed. if not, install pkg-config.

Then install GTK. (Sudo apt-get install libgtk2.0 *)

After installation: export PKG_CONFIG_PATH =/usr/local/ImageMagick/lib/pkgconfig/

Then reinstall the php extension of imagick.

Reference: http://www.cnblogs.com/niocai/archive/2011/07/15/2107472.html


4. after the compilation is successful, it will be in php? Extended directory generation imagick. so
My path is/usr/lib/php5/20090626 + lfs/


And then in php. ini? Add

Extension = "imagick. so"

Restart php? Phpinfo ()

Installation completed ....



?

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.