I have been trying for hours to get ImageMagick working on my localhost (running XAMPP 1.8.3 on Windows 7). I have checked and tried literally every solution that I can find on this website, and dozens of others. Nothing works. No matter what combination of ImageMagick builds and imagick DLLs I try, I always get some kind of "can't find dll" error when I try to start Apache (the specific message varies based on what combination I'm trying, but it's always some sort of missing DLL message). Can anyone just give me a (moderately recent) combination of XAMPP/ImageMagick/Imagick that works?
3 Answers
OK. I finally found a combination that works. After MUCH trial and error, I was finally able to get the below combination to work on my machine. Hopefully it works for anyone else who might be struggling with this.
- OS: Windows 7 64 Bit
- PHP: 5.5.6
- XAMPP: 1.8.3
- Compiler: MSVC11
- Architecture: x86
- ImageMagick: ImageMagick-6.7.7-5-Q16-windows-dll (available here)
- Imagick DLL: PHP5.5.x version from http://www.peewit.fr/imagick/
Note: Once I tried this, Apache started without any error messages. I did not have to restart my computer (just restarted Apache). I do have ImageMagick installed in a directory that has no spaces in the name (as some have suggested that might be a problem with some installs). In my case, I installed it to c:\xampp\imagemagick.
Best of luck to you!

- 8,084
- 8
- 48
- 62

- 721
- 1
- 5
- 11
-
Saved my life too. I lost hours trying to make it work, and nothing, until I followed your steps. – xZero Mar 20 '14 at 18:58
-
So glad to hear this was helpful. This is really just needlessly complex. I wasted days trying to find a configuration that would work. – Chris Stocking Apr 03 '14 at 06:54
-
Unfortunately this combination didn't work with xampp 1.8.3 (same version as yours), PHP Version 5.5.1 and windows 7 32bit. :( Guess I have to try other versions... – user2718671 Apr 16 '14 at 09:38
-
So how do you link the extension to the binaries? – TheRealChx101 May 25 '14 at 01:12
-
Works, thanks! :) If you're getting an error about version mismatch, download the DLL for your PHP version. – PiotrK Sep 18 '14 at 00:12
-
This also work for PHP 5.6.x, with the change that the Imagick DLLs are downloaded from http://windows.php.net/downloads/pecl/releases/imagick/3.1.2/ – Benjam Nov 29 '14 at 21:45
-
This worked for me (after trying different things for about 3 days), but I did have to add a environment variable MAGICK_HOME, pointing to "C:\ImageMagick\modules\coders" (or the relevant place within your install path). Didn't seem to work until I did that. – hessodreamy Jul 08 '15 at 15:23
-
At least, a working answer. Brief and clear. When you talk about Imagick DLL: PHP5.5.x, you have two choices: thread safe and non thread safe. The first one worked for me. – cabreracanal Aug 28 '15 at 07:42
Imagick is a PECL extension and the official windows.php.net site has compiled versions of PECL extensions.
Please download Imagick from: http://windows.php.net/downloads/pecl/releases/imagick/
And download ImageMagick from: http://windows.php.net/downloads/pecl/deps/
Please note, downloading Imagick from one site, and downloading ImageMagick from another site is likely to not work! This is because when Imagick is compiled it uses several settings that vary based on what versions of ImageMagick it is being compiled against.
FYI the maintainer of the Imagick extension recommends not running it inside Apache, but instead to run it as a background task through something like SupervisorD or cron. This is both for security and performance reasons.

- 24,939
- 16
- 90
- 122
-
Author of this post just saved my day. I had a lot of problems, because I downloaded distributive from authors, not from pecl deps. – BlitZ Oct 13 '16 at 08:02
After spending many hours trying to get this blasted thing to work (Windows 7, 64-bit), with no success, I decided to look at other systems to see how they handled the problem. What mediawiki did was simply NOT USE the ImageMagick/PHP extension! They call the ImageMagick convert.exe program directly and use the result (see includes/media/Bitmap.php in the mediawiki package).
You can't really blame people for abandoning the PHP extension, since apparently it has to be compiled with the "right" ever-varying compiler and matched at least with apache and ImageMagick builds. What is surprising about the situation is that this problem has been going on for over five years and it still isn't handled.
So my "solution/answer" isn't really one, it basically is to call ImageMagick a different way to avoid the problem, like mediawiki did.

- 5,068
- 1
- 19
- 12