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?
Answers
One solution seems to be to downgrade imagemagick:
http://howto.at/2011/08/02/super-speed-up-virtuozzo-with-debian-6-and-imagemagick/
There's a debian bug (#638409) opened about this, seems to be caused by imagemagick's use of openmp:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638409
Since we have this problem ourselves, we will be trying both solutions shortly :)
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
Download
ImageMagick-6.9.3-7-vc14-x86.zip
(32bit) orImageMagick-6.9.3-7-vc14-x64.zip
(64bit) fromhttp://windows.php.net/downloads/pecl/deps/
depending upon which WAMPServer version you are using i.e. 32bit or 64bitDownload
php_imagick-3.4.3-5.6-ts-vc11-x86.zip
(32bit) orphp_imagick-3.4.3-5.6-ts-vc11-x64.zip
(64bit) fromhttp://windows.php.net/downloads/pecl/releases/imagick/3.4.3/
depending upon which WAMPServer version you are using i.e. 32bit or 64bitCreate a folder to hold ImageMagick, I used
wampimagemagick
Unzip whichever of the ImageMagick's you downloaded i.e.
ImageMagick-6.9.3-7-vc14-x86.zip
orImageMagick-6.9.3-7-vc14-x64.zip
into thewampimagemagick
folderUnzip whichever of the imagick version you downloaded
php_imagick-3.4.3-5.6-ts-vc11-x86.zip
(32bit) orphp_imagick-3.4.3-5.6-ts-vc11-x64.zip
(64bit) into a temp folder and copy thephp_imagick.dll
from the temp folder to yourwampbinphpphp5.6.25ext
folderEdit your 'php.ini
file to add the extension. Use the wampmanager menus so you edit the correct file (left click) wampmanager->PHP->php.ini Add the line
extension=php_imagick.dllinto the section of
php.inithat contains the other
extension` parameters.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:wampimagick;
to the PATH variable in theSystem 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
If you have process explorer, check under Kernel memory - when my nvidia graphics driver crashes, I leak about 2gb of memory into there.
If you're looking at the paging lists in process explorer, it breaks down as follows: Zeroed - These pages are unused and have been overwritten with zeroes. Free - These pages aren't allocated at all. Modified - An application has changed this page, and it needs to be written to disk before it can be replaced. ModifiedNoWrite - An application has changed this page, but it doesn't need to be written back before being replaced. Standby - These pages were recently in use. If they are needed, then they can be reallocated to another application. The priority levels below show how likely windows thinks the page is going to be needed again. If an application uses a page once every second, then if windows reallocates that page to another application, it'll have to allocate it back every second, so that's not very useful if we have a page that was used 20 min ago by a background application and hasn't been used since that we could reallocate instead of shifting the same page back and forth between two applications every second. Your "available" memory is Zeroed+Free+Modified+ModifiedNoWrite+Standby
As for fixing it, if it's a driver that's crashing or leaking memory, you just have to replace the driver with a newer or older version that doesn't have this problem. Sadly I don't know of any way to see how much memory is allocated to each driver, though on a high-end system with 150 processes and 50000 handles open (steam, WoW, several editors, google chrome w/40 tabs), I'm using about 500mb of paged physical kernel memory, 500mb of paged virtual kernel memory, and 150mb of nonpaged kernel memory. If you're off by whole gigabytes when it's complaining about memory issues, a driver is misbehaving somewhere. The rest of your memory should be accounted for in the process list.
You may have to restart Internet Explorer or Firefox, or whatever browser you are using.
Also, try going to command prompt and typing:
ipconfig /flushdns
Lastly, double check you are typing google.com in the address bar and remember that both google.com and www.google.com are completely different as far as DNS is concerned and you will need to add an entry for both.
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.
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:xamppimagemagick.
Best of luck to you!