如何在 Windows 7 上安装 Imagick/imagemagick PHP 扩展
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3036847/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install Imagick/imagemagick PHP extension on windows 7
提问by DEVOPS
How to install image magic in Windows 7. I followed these instruction
如何在 Windows 7 中安装 image magic。我遵循了这些说明
To install IMagick on Windows XP (php 5.2.x)
在 Windows XP (php 5.2.x) 上安装 IMagick
download and install ImageMagick-6.5.8-7 Q16-windows-dll.exe http://www.imagemagick.org/download/binaries/ImageMagick-6.5.8-7-Q16-windows-dll.exe
download php_imagick_dyn-Q16.dll from: http://valokuva.org/outside-blog-content/imagick-windows-builds/080709/
copy dll to [PHP]/extension dir and rename it to php_imagick.dll
You have to edit your php.ini file and add new extension
extension=php_imagick.dllSave ini file and restart apache server.
(If necessary, restart your windows)
phpinfo()should show imagick enabled.
下载并安装 ImageMagick-6.5.8-7 Q16-windows-dll.exe http://www.imagemagick.org/download/binaries/ImageMagick-6.5.8-7-Q16-windows-dll.exe
下载php_imagick_dyn-Q16.dll来自: http://valokuva.org/outside-blog-content/imagick窗口,建立/ 080709 /
将 dll 复制到 [PHP]/extension 目录并将其重命名为 php_imagick.dll
您必须编辑 php.ini 文件并添加新的扩展名
extension=php_imagick.dll保存ini文件并重启apache服务器。
(如有必要,请重新启动 Windows)
phpinfo()应该显示启用 imagick。
after that I execute a sample script but its not working. It shows the Imagicclass missing error.
之后我执行了一个示例脚本,但它不起作用。它显示Imagic类丢失错误。
Fatal error: Class 'Imagick' not found in C:...\imgborder.php on line XXX
致命错误:在第 XXX 行的 C:...\imgborder.php 中找不到“Imagick”类
Please help me to install Imagick. :-(
请帮我安装Imagick。:-(
采纳答案by chanchal1987
Check permissions on the .dll file to make sure the Apache user has read access to the file. Better change the permission of the [PHP]/extension directory.
检查 .dll 文件的权限以确保 Apache 用户对该文件具有读取权限。最好更改[PHP]/extension 目录的权限。
To change the permission
更改权限
- Right click the file(s) or folder(s)
- Select "Properties"
- Select "Security" tab
- Click on "Edit" button.
- 右键单击文件或文件夹
- 选择“属性”
- 选择“安全”选项卡
- 单击“编辑”按钮。
Change the permission of user to Full Control.
将用户的权限更改为完全控制。
回答by Gras Double
- Download the binaries on the PECL page(look for the "DLL" links).
- alternative listing(more direct access, same files)
- Open the archive, copy all the *.dll files to the "php\ext" directory.
Add the extension to your php.ini:
- Usually you should add
extension=php_imagick.dll. - On some WAMP platforms, it might be instead
extension=ext/php_imagick.dll. Just look how the existing extensions are defined and do alike.
- Usually you should add
- Restart web server.
- 在PECL 页面下载二进制文件(查找“DLL”链接)。
- 替代列表(更直接的访问,相同的文件)
- 打开存档,将所有*.dll 文件复制到“php\ext”目录。
将扩展添加到您的 php.ini:
- 通常你应该添加
extension=php_imagick.dll. - 在某些 WAMP 平台上,它可能是
extension=ext/php_imagick.dll. 看看现有的扩展是如何定义的,并做类似的事情。
- 通常你应该添加
- 重新启动网络服务器。
At this point, Imagick is installed, but you will probably encounter this error:
此时,Imagick 已安装,但您可能会遇到此错误:
ImagickException: NoDecodeDelegateForThisImageFormat
ImagickException: NoDecodeDelegateForThisImageFormat
It means you have to install ImageMagick as well:
这意味着您还必须安装 ImageMagick:
- On this page, download the ImageMagick archive corresponding to the Imagick you have installed (MSVC version, CPU architecture).
- Open "bin" directory of this archive, copy the *.dll files to the "php\ext" directory. For example, you'll need IM_MOD_RL_jpeg_.dll for JPEG handling.
- 在此页面下载与您安装的 Imagick 对应的 ImageMagick 存档(MSVC 版本,CPU 架构)。
- 打开这个存档的“bin”目录,将*.dll文件复制到“php\ext”目录。例如,您需要 IM_MOD_RL_jpeg_.dll 来处理 JPEG。
回答by i0707
回答by funktioneer
I've research this solution, here you will find all necessary libraries. Download this http://image_magick.veidrodis.com/image_magick/binaries/ImageMagick-6.6.2-10-Q16-windows-dll.exe
我已经研究了这个解决方案,在这里你会找到所有必要的库。下载这个 http://image_magick.veidrodis.com/image_magick/binaries/ImageMagick-6.6.2-10-Q16-windows-dll.exe
Find your DLLs here http://www.peewit.fr/imagick/
在此处找到您的 DLL http://www.peewit.fr/imagick/
To know which library fit your needs easily run phpinfo()
要知道哪个库适合您的需求,请轻松运行 phpinfo()
There you find the following row e.g.
在那里您会找到以下行,例如
Compiler MSVC9 (Visual C++ 2008)
编译器 MSVC9 (Visual C++ 2008)
The MSVC9 tells you that it's compiled with Visual C9, so you need to download the VC9 version. Thats all.
MSVC9 告诉你它是用 Visual C9 编译的,所以你需要下载 VC9 版本。就这样。
Have nice day, takes me several hours of research.
祝你有美好的一天,我花了几个小时的研究。

