It took me several days to figure out the installation on Imagick on our Windows Server 2008 with PHP 5.3, no kidding. On a Linux server, it literally took a few minutes with "apt-get install..." etc.
The big lesson I learned is that it's all about VERSIONS for Windows:-
* Version of Imagick dll MUST match version of PHP
* Version of ImageMagick MUST match version of Imagick dll (NOT just the latest release)
* If you're a novice c/c++ programmer, don't waste time figuring out how to compile code from scratch (esp. with VS Express with no MFC support!)
1. If not already done, (initially) download and install the latest ImageMagick. I don't really know the significance but I opted for "Install development headers.." (
http://www.imagemagick.org/script/binar ... hp#windows)
2. Create a PHP script with phpinfo() to find out your version of :-
a) PHP
b) Compiler version
c) Architecture (32/64-bit)
d) Thread Safety (enabled/disabled)
3. Search for Imagick dll which support your version of software as above. In my case, it was (a) PHP 5.3, (b) Compiler MSVC9 on (c) x86 ie. 32-bit platform with (d) Thread Safety disabled
4. There are quite a few sources for download but I think the "official" one is the PHP Pecl website:
http://pecl.php.net/package/imagick
Down the list of versions you can see Windows icons next to some builds for downloading the dll. For me, I could see a version for PHP 5.3 NTS (Non-Thread Safe) here:
http://pecl.php.net/package/imagick/3.1.2/windows
5. Once downloaded, you want to find out which version of ImageMagick it is based on. I couldn't find an obvious way to do this for the version I have, but I noticed the zip file also contains a load of CORE_xx.dll's which I copy and paste'd into the existing ImageMagick installation folder - then in a new cmd prompt, I type "IDENTIFY" to see the version of the CORE_xxx.dll's. In my case it is:-
"Version: ImageMagick 6.8.6-9 2013-08-17 Q16 ..."
6. Search for this version of ImageMagick, I found one ("ImageMagick-6.8.6-9-Q16-x86-windows.zip") on one of the ImageMagick mirror dowload sites:
http://ftp.sunet.se/pub/multimedia/grap ... /binaries/
7. Either uninstall the current ImageMagick and download/install this matching version (to php_imagick.dll) OR I think it's fine to install multiple versions where the last install will be assumed default
8. Restart the server machine (required) to register the new ImageMagick and with any luck you should see the "imagick" section in phpinfo page created earlier.
I'm just posting my experience in the hope of benefitting others - also as a wiki for my own future reference!
Now that I have a working PHP Imagick on Windows I do notice some programming differences (further pain!) with the version I installed on a Linux server, for example it can't work out relative paths e.g.
..doesn't assume the png file is in the same folder as the PHP script itself, I have to do:-
Code: Select all
$im = new Imagick("d:/mydevpath/myimage.png");
or
Code: Select all
$im = new imagick (__DIR__ . DIRECTORY_SEPARATOR . 'myimage.png');
Similar issue with a URL source (still have to figure that out)
Hope all this helps!