Trying to get imagick running on PHP 5.4.3 at Windows x64
Asked Answered
C

3

6

I have Windows 7 64 bits, PHP 5.4.3 installed through WAMP 2.2 and imagick (ImageMagick-6.8.3-9-Q16-x64-dll.exe). I tried to use the php's dll of imagick from a lot of sources but all of them give this error in apache_error.log:

PHP Warning:  PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0

Any thoughts on how to solve this?

Colorific answered 16/3, 2013 at 4:16 Comment(0)
C
4

perhaps this can help you: step-by-step instructions for installing IMAGEMAGICK on WAMP? and

http://www.elxsy.com/2009/07/installing-imagemagick-on-windows-and-using-with-php-imagick/

"Just to make things clear, all the PHP dll files (librarires) are 32 bit, so if your system is 64 bit and you will still need to download and operate 32 bit ImageMagick, Apache, etc."

Crevice answered 22/3, 2013 at 9:35 Comment(2)
64bit dll for imagemagick can be found here: pecl.php.net/package/imagick/3.1.2/windowsVanadium
The above comment about operating 32bit ImageMagick, Apache etc is incorrect. It works fine in all-64bit setting with correct libraries.Illomened
S
3

I went through the same pain. Win64+php-x86. It ended up being something relatively simple to fix - it is all about paths.

I first had installed the full ImageMagic-x64, then eventually the extension. I later noticed that installer had appended ImageMagic in the beginning of the PATH. Just in case I tried with the x86 version and got different errors about missing DLLs.

So, just in case I uninstalled ImageMagic completely and cleaned up all references to it from the environment (it was in the PATH and MAGICK_HOME).

Then I installed just the extension (in my case from http://windows.php.net/downloads/pecl/releases/imagick/3.1.2/ I got php_imagick-3.1.2-5.4-nts-vc9-x86.zip) and unpacked it in the ext folder.

The revelation came after I tried to run this from the command prompt: php -i and got an error that it could not find CORE_RL_wand_.dll - but I did see it in the ext folder!

Adding C:\Progra~2\PHP\EXT at the end of the PATH environment variable solved it (after making sure that there are no other DLLs interfering).

Note: I used the 8.3 path to "C:\Program Files (x86)\php\ext" - just in case as I've seen PHP being sometimes picky and unable to resolve paths with spaces in them.

Also - after messing up with the PATH you may have to reboot the PC - in my case it worked from a command prompt right away, but IIS had a cached (older) path.

In conclusion: I suspect the PHP extension relies on some DLLs (which it delivers as part of the ZIP) but the same ones are also part of the standard ImageMagick installation, except that the two are not exactly the same - if you happen to be loading the wrong ones fun things happen...

Shandy answered 17/12, 2014 at 2:24 Comment(0)
I
1

For a 64bit WAMP (PHP 5.4.x, PHP 5.4.12 thread safe in my case) a working combination is the following:

ImageMagick-6.8.7-8-Q16-x64-dll.exe or possibly latest Q16/x64/DLL from here: Link

and php_imagick-svn20120508-5.4-VC9-x64 from here: http://www.mediafire.com/php-win64-extensions

Illomened answered 8/1, 2014 at 10:30 Comment(1)
Incredible, this worked, after hours of trying various combinations. However, the 6.8.7-8-Q16-dll version is no longer available on the link you posted, but can be found hereSpinifex

© 2022 - 2024 — McMap. All rights reserved.