Đang cố gắng để tưởng tượng chạy trên PHP 5.4.3 ở Windows x64 (Trying to get imagick running on PHP 5.4.3 at Windows x64)


問題描述

Đang cố gắng để tưởng tượng chạy trên PHP 5.4.3 ở Windows x64 (Trying to get imagick running on PHP 5.4.3 at Windows x64)

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?


參考解法

方法 1:

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."

方法 2:

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...

方法 3:

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

(by Frederico Schardongan_animalVladimir Strinskiguntars)

參考文件

  1. Trying to get imagick running on PHP 5.4.3 at Windows x64 (CC BY‑SA 3.0/4.0)

#imagick #PHP #php-extension






相關問題

Imagick 安裝錯誤 - 類未定義 (Imagick Installation Errors - Class Undefined)

GD/Imagick 不保存我的圖像 (GD/Imagick doesn't save my image)

Imagick 使用不同的目錄和數據庫 PDF 來縮略圖 JPG (Imagick using different directory and database PDF to thumbnail JPG)

如何在不損失分辨率和質量的情況下減小圖像尺寸(高度、寬度) (How to decrease image size(height, width) without losing its resolution and quality)

Đang cố gắng để tưởng tượng chạy trên PHP 5.4.3 ở Windows x64 (Trying to get imagick running on PHP 5.4.3 at Windows x64)

WampServer 和 Imagemagick,無法識別 imagick php 模塊 (WampServer and Imagemagick, imagick php module not recogized)

PHP Imagick:如何將自定義圖像屬性保存到文件 (PHP Imagick: How to save custom image property to file)

PHP Imagick - 顯示多圖像 TIFF 的第一片 (PHP Imagick - display first slice of mutli image TIFF)

可以加快 php/imagick 中的圖像加載速度 (Possible to speed up image loading in php/imagick)

PHP imagick 相當於 -define png:color-type=6 (PHP imagick equivalent of -define png:color-type=6)

php Imagick::levelImage 使用 (php Imagick::levelImage usage)

imagick:無法查詢字體度量 (Imagick: Failed to query the font metrics)







留言討論