How to install the ImageMagick PHP extension in Windows

In order to install the imagick PHP extension on Windows, you need to know the exact version of your PHP. To do this: open a command prompt and enter these commands:

  • Determine the PHP version:
    php -i|find "PHP Version"
  • Determine the thread safety
    php -i|find "Thread Safety"
    You’ll have enabled for thread safe or disabled for not thread safe
  • Determine the architecture
    php -i|find "Architecture"
    You’ll have x86 for 32 bits and x64 for 64 bits

 

Go to https://mlocati.github.io/articles/php-windows-imagick.html in order to download the requried files.

Once you downloaded the correct files:

  1. Extract from php_imagick-….zip the php_imagick.dll file, and save it to the ext directory of your PHP installation
  2. Extract from ImageMagick-….zip the DLL files located in the bin folder that start with CORE_RL or IM_MOD_RL, and save them to the PHP root directory (where you have php.exe), or to a directory in your PATH variable
  3. Add this line to your php.ini file:
    extension=php_imagick.dll
  4. Restart the Apache/NGINX Windows service (if applicable)