dongshuo8756 2012-10-24 10:06
浏览 158
已采纳

致命错误:未找到“Imagick”类

PHP 5.3.8

WAMP 2.2.21

ImageMagick 6.6.2 Q16


Fatal error: Class 'Imagick' not found happens no matter what. No matter how many times I...

  1. Install/reinstall different versions of ImageMagick
  2. Try various VC9 builds of php_imagick.dll to 'wamp\bin\php\php5.3.8\ext\'
  3. Have updated my php.ini to include 'extension=php_imagick.dll'
  4. Have restarted my pc and WAMP... I can't count how many times O_o

I also get this error on WAMP startup

enter image description here


The funny thing is that php_imagick.dll shows up in my PHP extensions via the WAMP taskbar

enter image description here

but not in my localhost PHP-Loaded Extensions:

localhost Loaded Extensions


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.

  • 写回答

1条回答 默认 最新

  • dt3674 2012-10-24 10:33
    关注

    You are not loading the php_imagick.dll extension.

    Check first of all that the file is there and is readable. If it is, then it is not loading because the DLL itself requires some other DLL; this error isn't usually shown by Windows. You will need some tool such as DEPENDS to load php_imagick.dll and see what unresolved externals it contains.

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

    For example, a sample PHP 5.3 php_imagick.dll I found turns out to depend on these two DLL's

    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 might work for you too, but read on)

    ImageMagick - "CORE_RL_magick_.dll not found" or how to install RMagick on windows with ruby 1.9.2

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

    Now, what should you do? It depends. Literally; for instead of blindly reinstalling at random until the stars are right (again: it might work. It often does!), I would fire up DEPENDS on the imagick DLL, 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.

    (That's why it's called "DLL Hell").

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条