Installing ImageMagick extension with php/windows

Found very useful tha answer given by user Buttercup, also if he could be more clear.

My scenario was a Windows 2012 R2 x64, PHP 5.5.19 x64 and need to install ImageImagick with PHP support. Following points here below I was able to install ImageImagick 6.9.0 x64 and PHP_Imagick.dll 3.1.2 (both are currently the latest stable versions).

Please note I downloaded all components (PHP, ImageImagick and PHP_Imagick) in NTS and x64 modes: not in TS and/or x86 modes. I don’t know if this apply in your own case.

The point it wasn’t clear for me reading the Buttercup (as for user RhoVisions) was his comment: “Overwrite the DLLs found from ImageMagick 6.8.8 Windows version with the PHP version”.

So, this is what I’ve done (based on Buttercup solution, who I have to say again and again thank you very much!):

  1. download latest ImageMagick EXE installer from Link
    In my case I downloaded the first file available as HTTP download labeled “Win64 dynamic at 16 bits-per-pixel” (filename: ImageMagick-6.9.0-0-Q16-x64-dll.exe)

  2. Run the installer just downloaded. I installed it in a simple path like C:\ImageMagick6.9.0 (but I don’t think it is so important to move it away from Program Files). Also, I didn’t change any other parameter from their defaults during installing.

  3. download latest PHP_Imagick DLL file from PECL website at: http://pecl.php.net/package/imagick
    I choosed a stable (not Beta or RC) version, in my case 3.1.2, clicking on the “Windows logo”+”DLL” label. In my case it was linked to ht tp://pecl.php.net/package/imagick/3.1.2/windows .
    On the page it will open you’ll find a table: you have to choose your file depending on:
    a) number of version of PHP you have (in my case there were available DLLs for PHP 5.3, 5.4, 5.5, 5.6)
    b) x64 or x86 version of PHP you have
    c) NTS or TS version of PHP you have
    My case is was PHP 5.5.x, x64, NTS: so I downloaded the one labeled “5.5 Non Thread Safe (NTS) x64” (file name: php_imagick-3.1.2-5.5-nts-vc11-x64.zip)

  4. Unzip the php_imagick ZIP and:
    a) copy php_imagick.dll file into the EXT folder of your PHP installation
    b) copy and replace ALL the CORE_RL_.dll from the folder you just unzipped into the folder you choosed at point #2. Obviously, please backup replaced files. In my case I copied 8 CORE_RL_.dll files from unzipped folder to C:\ImageMagick6.9.0. I leaved into C:\ImageMagick6.9.0 the others CORE_RL_*.dll not overwritten.

  5. Edit and save your PHP.ini file in order to add this simple row:
    extension=php_imagick.dll

  6. Reboot your server (unfortunally I didn’t find any good alternative of a reboot: also a IISRESET from admin command-prompt didn’t work).

  7. When reboot finished, visit remotely by browser your phpinfo.php file in order to verify that Imagick module was ok. In my case it was.

Hope this could help, out there!

Leave a Comment