In the recent PHP project, you need to use the transduction and thumbnail effects, in the local Windows development environment, the installation process encountered a lot of problems, here to share with you.
PHP official website, a large group of foreigners can not understand how to install this thing, the main reason is that the PHP version of the complex, there are x86 x64 NTS TS, the corresponding Imagick version is not necessarily the same, imagick the first pass is easy, there is always a way to install, Imagick corresponding to the ImageMagick program is not necessarily, and the emergence of a complex version, even if the official website of the dependent version has no effect, at the same time there is no official any place to give a reasonable installation method, is abnormal. From Chinese to English, from PHP documents to Baidu, Google data, various versions, all are pits!
Use environment
Installation steps
Download appropriate Imagick extensions and ImageMagick programs based on your environment
1. Download extension
One: http://windows.php.net/downloads/pecl/releases/imagick/
Two: Https://pecl.php.net/package/imagick
Important: Note the PHP version of TS or NTS x86 or x64
This is based on phpinfo ()
So I should download Imagick 3.4.3 version PHP5.6 Non Thread Safe (NTS) X86 expansion--php_imagick-3.4.3-5.6-nts-vc11-x86.zip
2. Installation and expansion
- After extracting the above files, copy the Php_imagick.dll to the Php/ext directory, or any other directory where you store your extension.
- Modify PHP.ini plus extension=php_imagick.dll, note that PHP may have multiple ini, with phpinfo as the subject
- At this time to copy the other DLLs extracted from the above file directory to the PHP directory, restart Apache, at this time Phpinfo display expansion installation success, but ImageMagick number of supported formats 0, to the successful installation of half
3 Download ImageMagick Program
: http://windows.php.net/downloads/pecl/deps/
ImageMagick also has official website download, here does not encourage the official download from ImageMagick, their website I did not find the historical version download, the chance of installation failure is very large
Download the version that is consistent with the Phpinfo prompt, and you need to note 1. Software version corresponds to 2.VC11 or Vc14 3.x86 or x64 to Phpinfo, my
So I downloaded imagemagick-6.9.3-7
4 Installing the ImageMagick program
- After extracting the downloaded files, the whole program is copied into a directory without space and Chinese characters E:\Program files (x86) \
- Configure the environment variables, in the "This PC" right "properties", click "Advanced" "Environment variable", in "system variables" find the key path data, double-click Path, select "New", will just put the program's directory "E:\Program Files (x86) \ Imagemagick\bin "Fill in Can
- All of the "E:\Program Files (x86) \imagemagick\bin" directories. DLL ' suffix file into the root directory of PHP, there should be 145
Restart your computer
Imagick Installation of PHP extensions