Page 1 of 1

Install for PHP 5.4 on Windows server

Posted: 2013-12-20T04:20:48-07:00
by nils@iqweb.se
Trying to install Imagick.dll on Windows server for PHP 5.4 , but not sure of what verion of Imagick I should install

Re: Install for PHP 5.4 on Windows server

Posted: 2013-12-21T09:49:07-07:00
by Bonzo
You want a version later than 3.1.0 as there was a compatability issue with php 5.4
I recived an error every time somebody visited my website and the error list grew very fast!

Re: Install for PHP 5.4 on Windows server

Posted: 2014-01-20T07:24:03-07:00
by nils@iqweb.se
Thanks for your help

Re: Install for PHP 5.4 on Windows server

Posted: 2014-01-20T10:24:19-07:00
by fmw42
I believe this may be the latest version of Imagick

http://pecl.php.net/package/imagick/3.1.0RC2

Re: Install for PHP 5.4 on Windows server

Posted: 2014-01-29T04:20:42-07:00
by jaslee
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.

Code: Select all

$im = new Imagick("myimage.png");
..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!

Re: Install for PHP 5.4 on Windows server

Posted: 2014-01-29T06:05:59-07:00
by Bonzo
Thanks for the info jaslee.