如何在 wamp64 上安装 php_imagick

How to install php_imagick on wamp64

我一直在尝试在 wamp64 上安装 php_imagick,但没有成功。

期望的目标是让 WordPress 停止显示错误消息:

The optional module, Imagick, is not installed or has been disabled.

您也可以跳过阅读并查看下面的附件。

我的设置:

Wamp64 Windows 10 Release Version 3.2.3.3 64 Bits [Windows Build: 19041]
PHP Version: 7.4.9
Build Date: Aug 4 2020 11:45:36
Windows: NT *username* 10.0 build 19041 (Windows 10) AMD64
Compiler Visual: C++ 2017
Architecture: x64
Loaded Configuration File: C:\wamp64\bin\apache\apache2.4.46\bin\php.ini
Thread Safety: enabled

我尝试安装以下 ImageMagick 文件:

1) ImageMagick-7.0.10-30-Q16-HDRI-x64-dll.exe
----A) php_imagick-3.4.3rc1-5.6-ts-vc11-x64.zip
----B) php_imagick-3.4.3rc1-7.1-ts-vc14-x64.zip
2) ImageMagick-7.0.10-30-Q16-x64-dll.exe
----A) php_imagick-3.4.3rc1-7.1-ts-vc14-x64.zip
----B) php_imagick-3.4.4rc2-7.3-ts-vc15-x64.zip
3) ImageMagick-6.9.3-7-Q16-x64-dll.exe (Current)
----A) php_imagick-3.4.4rc2-7.3-ts-vc15-x64.zip (Current)
----B) php_imagick-3.4.3rc1-7.1-ts-vc14-x64.zip
----C) php_imagick-3.4.3rc1-5.6-ts-vc11-x64.zip

我做了什么:

我先安装了 EXE 文件,然后从 zip 文件中将 php_imagick.dll 文件解压到这个文件夹中:

C:\wamp64\bin\php\php7.4.9\ext

与我当前使用的 PHP 版本相匹配(有关更多信息,请参阅稍后的图片[php.ini])。

我尝试重新启动 Wamp,通过切换 PHP/Apache 版本重建符号链接。

还值得一提的是,我曾尝试将完整的 zip 解压到名为 'php_imagick' 的文件夹下的 'ext' 文件夹中,如下所示,但确实遇到了这个错误:

C:\wamp64\bin\php\php7.4.9\ext\php_imagick\php_imagick.dll (The specified procedure could not be found.)

但大多数时候我收到这些错误:

[25-Sep-2020 08:58:50 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'php_imagick.dll' (tried: c:/wamp64/bin/php/php7.4.9/ext/php_imagick.dll (The specified module could not be found.), c:/wamp64/bin/php/php7.4.9/ext/php_php_imagick.dll.dll (The specified module could not be found.)) in Unknown on line 0

当我使用 EXE 安装 Magick 时,我确保检查 install to the path,将文件夹更改为 C:\ImageMagick,并在可能的情况下按照 Stack 上的建议安装 legacy drivers溢出。 (我也确保卸载我每次尝试的最后一个版本)

我已经 Visual Studio 安装了一堆可再发行组件,还有这些的 x86 和 x64 版本:

https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

http://www.microsoft.com/en-us/download/details.aspx?id=30679

运气不好,我继续阅读了几篇 Stack OverFlow 帖子,但找不到解决方案。

step-by-step instructions for installing IMAGEMAGICK on WAMP?

Installing php_imagick.dll PHP extension on wampserver 2.2

step-by-step instructions for installing IMAGEMAGICK on WAMP?

Installing php_imagick.dll PHP extension on wampserver 2.2

WAMP PHP Startup Error: Unable to load dynamic library

Installing ImageMagick extension with php/windows

Linker error when trying to use ImageMagick as static libraries with Visual Studio compiler

Installing Magick++ in Visual C++ 2010

Installing Magick++ in visual studio 2019

ImageMagick with Visual Studio

WampServer and Imagemagick, imagick php module not recogized

Cannot load imagick library

ImageMagick not working

接下来我可以尝试什么?

第 955 行的拼写错误:.php=.dll

我聘请了一名自由职业者为我们解决这个问题。

  • 卸载 您安装的任何版本的 WampServer 和 ImageMagick
    • 卸载前不要忘记备份数据库和 www 文件夹
    • 我们将安装一个名为 Chocolatey 的可信赖软件,它将帮助我们修复 Wamp64 及其扩展的一系列错误,并帮助我们使用一个命令更新这些应用程序。

For those of you who already fixed this before using Chocolatey and now seeing this error message again simply update Wamp and ImageMagick using the choco commands provided on their website and then read my note under 4) for more information


  1. 运行 PowerShell 作为管理员

  2. 用同样的方法下载 Wamp64 https://chocolatey.org/packages/wamp-server

    • 运行 从您桌面上新创建的快捷方式 Wamp
    • 将 PHP 版本更改为 7.4.9 或最新版本,然后才移动
      到其他步骤
    • 不要担心文件夹名为 Wamp 而不是 Wamp64。它仍然是64位版本。您可以在 Wamp
    • 的关于部分查看
  3. 下载 https://chocolatey.org/packages/imagemagick

  4. 下载 https://windows.php.net/downloads/pecl/deps/ImageMagick-7.0.7-11-vc15-x64.zip

    • 注意:如果这不起作用,他们可能会再次更新。只需使用比这些更新的版本尝试相同的方法。我将首先尝试更新版本的 php_imagick 而不是替换 ImageMagick 核心 DLL 文件。我不会做的一件事就是放弃。
  5. 提取复制所有CORE_RLIM_MOD_RL DLL 文件到 C:\wamp\bin\php\php7.4.9,其中 php.exe 位于

    (不要从这里 运行 任何 EXE 文件,因为我们已经安装了 ImageMagick)

  6. 下载 https://windows.php.net/downloads/pecl/releases/imagick/3.4.4/php_imagick-3.4.4-7.4-ts-vc15-x64.zip

  7. 提取复制只是php_imagick.dll文件到C:\wamp\bin\php\php7.4.9\ext

  8. 通过 left-clicking Wamp->PHP->php.ini 打开 你的 php.ini 文件并然后确保删除所有剩菜,并在任何 extention= 行下方 添加 以下代码:

extention=imagick

(Apparently, New PHP versions require writing it without the "php_"...".dll" parts)
  1. 重新启动 Wamp 通过关闭它然后从快捷方式重新打开它

享受

我使用 wampserver 3.2.3 64bit 和 PHP 7.3.

  • 将 CORE_RL 和 IM_MOD_RL DLL 复制到 PHP 根目录中 orr burgel recommended 对我不起作用。
  • 我不得不将这些 DLL 复制到 c:\wamp64\bin\apache\apache2.4.41\bin.