Windows / PHP / ImageMagick / php_imagick: ‘no decode delegate for this image format’ or ‘ImageMagick number of supported formats: => 0’

After spending quite some time to install imagick for PHP under Windows, I’ve finally gotten a solution that work. Fetch the prebuilt binary files from pecl (select the newest one with a windows icon behind it), and download the version for your platform. If you’re not sure, you probably want Thread Safe (if running under Apache) and x86 (you can see which platform your PHP is compiled for at the top of the phpinfo() output).

After enabling the extension, you’ll probably get a few error message about missing DLLs. This is where it gets interesting – quite a few sources on the internet will tell you to install the ImageMagick distribution for Windows, but the current version of php_imagick uses a few deprecated functions in wand, etc. Previously the dll-s bundled with imagick in the same library could be copied into the installed version of imagick, but this doesn’t seem to work any longer.

However, hidden in a PHP bug report, there’s a path to a repository of dependencies for running php_imagick under Windows, which is the complete set of compiled dll files it expects. Download the correct version of ImageMagick (something like ImageMagick-6.8.8-…) and unpack it. I ended up copying everything from bin/ into my ImageMagick installation dir, but that’s .. rather overkill and will probably cause some mystery error in the future. Copy them to a separate location that you add to your path and test PHP from the command line. Hopefully you’ll see more supported image formats now!