Imagick and imagemagick extensions for installing php in Windows 7 _ PHP Tutorial

Source: Internet
Author: User
Tags imagemagick
Install the imagick and imagemagick extensions of php in Windows 7. In recent PHP projects, you need to use the effects of cropping and shrinking graphs. you can easily install the phpimagick extension on the linux testing server. However, in the local windows development environment, the latest PHP project installation process requires the effects of cropping and shrinking graphs. on the linux testing server, you can easily install the php imagick extension. However, in the local windows development environment, the installation process has encountered many problems. I would like to share with you here.

1. download ImageMagick
: Http://imagemagick.org/script/binary-releases.php#windows

Download the latest version, imagemagick-6.8.6-9-q16-x86-dll.exe

2. install ImageMagick
Install ImageMagick on the PC. The installation path cannot contain spaces. Otherwise, the installation path cannot be used. During installation, add the execution path to the path. Otherwise, you must manually add the path.

3. test and install
Open the windows command line window (win + r-> "cmd"-> Enter), Enter convert, and press Enter. The convert help document will appear. if it does not appear, it indicates that the installation is not successful, or the installation directory is not added to the environment variable path.

Add to environment variables. for example, the installation directory of ImageMagick is c:/imagemagick.

Add process:
My computer-> right-click-> Advanced System Settings-> Advanced-> environment variables-> System variables-> path-> select and edit-> put your installation directory, add to it

4. Download php extension php_imagick.dll


Php5.4.x or php5.5.x http://www.peewit.fr/imagick/.

Dyn = dynamic, st = static, q16 = 16 bit, q8 = 8 bit.

The above logo is the same as the ImageMagick download logo you downloaded. I use q16

5. rename the dll file to php_imagick.dll and put it in the php extension file directory php/ext.

6. add extension = php_imagick.dll in the php. ini configuration file.

7. restart the computer. restart the PC if apache is not used. Because the extended underlying layer uses the imageMagic software, the software restarts the computer, reloads the software, and refreshes the path.

8. after restarting, open the phpinfo page and check that the extension has been installed successfully. If the installation is not successful, it is very likely that the imagemagick software version is too high. select a lower-level version for installation.

9. PHP test code.

<?php$im = new imagick( 'a.jpg' );// resize by 200 width and keep the ratio$im->thumbnailImage( 200, 0);// write to disk$im->writeImage( 'a_thumbnail.jpg' );

10. view the manual and learn the API

Extended Learning Manual address http://uk3.php.net/manual/zh/book.imagick.php manual contains a large number of easy-to-use instances.

Here is a document http://www.imagemagick.org/Usage/ for viewing command line parameters

Extended imagick. But in the local windows development environment, the installation process...

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.