且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Imagick委托在WAMP上进行安装

更新时间:2023-02-21 23:03:37

In the past this has worked by installing ImageMagick and then downloading a compatible imagick PHP extension.

But currently there seems to be a temporary "Catch 22" situation with ImageMagick and imagick.

imagick versions need to be compiled against a specific version of ImageMagick and currently that has not been done for imagick against the new ImageMagick 7 although I am informed by @danack that imagick is ready to be compiled but nobody has done so yet, or at least they have not shared the binary.

Unfortunately ImageMagick do not retain older versions of their install i.e. ImageMagick 6.? so if you dont already have a version of the installer the only availaible one is ImageMagick 7

The Catch 22

Therefore the only versions of imagick available will only work with ImageMagick 6 and you cannot download ImageMagick 6 as the ImageMagick people do not retain old version of their installer.

The work around

However, if you only want ImageMagick to work within a PHP/Apache environment this proceedure works.

The versions of the following must match your WAMPServer, so if you installed WAMPServer 32bit use the 32bit versions of ImageMagick and Imagick, if you use WAMPServer 64bit, use the 64bit versions of ImageMagick and Imagick. The VC14 versions should work with WAMPServers Apache 2.4.x versions

  1. Download ImageMagick-6.9.3-7-vc14-x86.zip (32bit) or ImageMagick-6.9.3-7-vc14-x64.zip (64bit) from http://windows.php.net/downloads/pecl/deps/ depending upon which WAMPServer version you are using i.e. 32bit or 64bit

  2. Download php_imagick-3.4.3-5.6-ts-vc11-x86.zip (32bit) or php_imagick-3.4.3-5.6-ts-vc11-x64.zip (64bit) from http://windows.php.net/downloads/pecl/releases/imagick/3.4.3/ depending upon which WAMPServer version you are using i.e. 32bit or 64bit

  3. Create a folder to hold ImageMagick, I used wamp\imagemagick

  4. Unzip whichever of the ImageMagick's you downloaded i.e. ImageMagick-6.9.3-7-vc14-x86.zip or ImageMagick-6.9.3-7-vc14-x64.zip into the wamp\imagemagick folder

  5. Unzip whichever of the imagick version you downloaded php_imagick-3.4.3-5.6-ts-vc11-x86.zip (32bit) or php_imagick-3.4.3-5.6-ts-vc11-x64.zip (64bit) into a temp folder and copy the php_imagick.dll from the temp folder to your wamp\bin\php\php5.6.25\ext folder

  6. Edit your 'php.inifile to add the extension. Use the wampmanager menus so you edit the correct file (left click) wampmanager->PHP->php.ini Add the lineextension=php_imagick.dllinto the section ofphp.inithat contains the otherextension` parameters.

  7. Add the folder to your windows PATH using Control Panel -> System -> Advanced System Setting Select the Advanced Tab Click the Environment Variables Button Add C:\wamp\imagick; to the PATH variable in the System Variables section [I dont like adding anything to the PATH for WAMPServer, but I cannot think of a better solution for now and as this way will work for multiple versions of PHP it is not actually so bad]

Start WAMPServer, or restart Apache. It may be necessary to reboot windows, it was for me, but maybe that was because I tried a number of things before I got to this solution.

Check with phpinfo() you should see