php 致命错误:找不到“Imagick”类
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13047015/
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
Fatal error: Class 'Imagick' not found
提问by Terry
PHP 5.3.8
PHP 5.3.8
WAMP 2.2.21
WAMP 2.2.21
ImageMagick 6.6.2 Q16
ImageMagick 6.6.2 Q16
Fatal error: Class 'Imagick' not foundhappens no matter what. No matter how many times I...
致命错误:无论如何都找不到“Imagick”类。无论我多少次...
- Install/reinstall different versions of ImageMagick
- Try various VC9 builds of php_imagick.dll to 'wamp\bin\php\php5.3.8\ext\'
- Have updated my php.ini to include 'extension=php_imagick.dll'
- Have restarted my pc and WAMP... I can't count how many times O_o
- 安装/重新安装不同版本的 ImageMagick
- 尝试各种 VC9 版本的 php_imagick.dll 到 'wamp\bin\php\php5.3.8\ext\'
- 已更新我的 php.ini 以包含“extension=php_imagick.dll”
- 已经重新启动了我的电脑和 WAMP...我数不清有多少次 O_o
I also get this error on WAMP startup
我在 WAMP 启动时也收到此错误


The funny thing is that php_imagick.dll shows up in my PHP extensions via the WAMP taskbar
有趣的是 php_imagick.dll 通过 WAMP 任务栏显示在我的 PHP 扩展中


but not in my localhost PHP-Loaded Extensions:
但不在我的本地主机 PHP 加载扩展中:


Does anyone have any ideas to why this is happening? Or any suggestions?
有没有人对为什么会发生这种情况有任何想法?或者有什么建议?
SOLUTION: I had to learn the hard way... WAMP 2.2 x32 NOT x64, ImageMagick 6.6.4 Q16 at the greatest.
解决方案:我必须以艰苦的方式学习... WAMP 2.2 x32 而不是 x64,ImageMagick 6.6.4 Q16 最多。
采纳答案by LSerni
You are not loading the php_imagick.dllextension.
您没有加载php_imagick.dll扩展程序。
Check first of all that the file isthere and is readable. If it is, then it is not loading because the DLL itselfrequires some other DLL; this error isn't usually shown by Windows. You will need some tool such as DEPENDSto load php_imagick.dlland see what unresolved externals it contains.
首先检查文件是否存在并且可读。如果是,则不会加载,因为DLL 本身需要其他一些 DLL;Windows 通常不会显示此错误。您将需要一些工具(例如DEPENDS)来加载php_imagick.dll并查看它包含哪些未解析的外部内容。
You will probably find that some functions are imported by a library (such as libeay32.dll) that is maybe associated with an extension you did not load, or is in the PHP directory but ought to have been copied into Windows' SYSTEM directory, or maybe uses a different VC runtime (e.g MSVCR90.DLL).
您可能会发现某些函数是由库(例如libeay32.dll)导入的,该库可能与您未加载的扩展相关联,或者位于 PHP 目录中但应该已复制到 Windows 的 SYSTEM 目录中,或者可能使用了不同的 VC 运行时(例如MSVCR90.DLL)。
For example, a sample PHP 5.3 php_imagick.dllI found turns out to depend on these two DLL's
例如,php_imagick.dll我发现的一个示例 PHP 5.3依赖于这两个 DLL
CORE_RL_WAND_.DLL
CORE_RL_MAGICK_.DLL
and guess what, CORE_RL_MAGICK is itself depending on other symbols, which explains the problems this guy was experiencing (his solution was maybe a bit more thorough than necessary, but hey, whatever works -- and it mightwork for you too, but read on)
猜猜看,CORE_RL_MAGICK本身依赖于其他符号,这解释了这个人遇到的问题(他的解决方案可能比必要的更彻底,但是嘿,无论什么都有效——它也可能对你有用,但请继续阅读)
ImageMagick - "CORE_RL_magick_.dll not found" or how to install RMagick on windows with ruby 1.9.2
ImageMagick - “CORE_RL_magick_.dll 未找到”或如何在带有 ruby 1.9.2 的 Windows 上安装 RMagick
Looking into CORE_RL_MAGICK again with DEPENDS turns out a dependence on a specific version of Visual C++ Runtime (and QT too, for some versions of IM), which ties this in the ugly can of worms known as "VC6 against VC9" (e.g. http://www.websiteadministrator.com.au/articles/install_guides/installing_php533_pg2.html).
使用 DEPENDS 再次查看 CORE_RL_MAGICK 发现依赖于特定版本的 Visual C++ 运行时(以及 QT,对于某些版本的 IM),这与称为“VC6 对抗 VC9”的丑陋蠕虫罐头相关联(例如http: //www.websiteadministrator.com.au/articles/install_guides/installing_php533_pg2.html)。
Now, what should youdo? It depends. Literally; for instead of blindly reinstalling at random until the stars are right (again: it mightwork. It often does!), I would fire up DEPENDS on the imagickDLL, then on ImageMagick core DLL, and so on, until I hunted down the maze of twisty little dependencies, all alike, that Windows ought to tell you about, but doesn't.
现在,你该怎么办?这取决于。字面上地; 因为不是盲目地随机重新安装直到星星是正确的(再次:它可能会起作用。它经常起作用!),我会根据imagickDLL 启动,然后在 ImageMagick 核心 DLL 上启动,依此类推,直到我找到迷宫曲折的小依赖,所有这些,Windows 应该告诉你,但没有。
(That's why it's called "DLL Hell").
(这就是为什么它被称为“ DLL 地狱”)。

