繁体   English   中英

如何在 Windows PHP 7.0 上安装 Imagick 扩展

[英]How to install Imagick extension on Windows PHP 7.0

我需要在我的 Apache - PHP 7.0 服务器上安装 Imagic 扩展。 我遵循了位于此处的非常好的指南: https : //herbmiller.me/2016/06/16/installing-imagick-php-7/ 基于“php -i”输出:

PHP Version => 7.0.13
Compiler => MSVC14 (Visual C++ 2015)
Architecture => x86
Thread Safety => enabled
extension_dir => D:\Program Files (x86)\PHP7\ext => D:\Program Files (x86)\PHP7\ext

我下载了文件

php_imagick-3.4.3rc4-7.0-ts-vc14-x86.zip

来自http://windows.php.net/downloads/pecl/releases/imagick/3.4.3rc4/ 我将所有 DLL 文件复制到 D:\\Program Files (x86)\\PHP7\\ext 并添加

extension=php_imagick.dll

到我的 PHP.INI。 当我重新启动 Apache 时,未加载 Imagic 扩展并且事件查看器显示 2 个相同的错误:

The description for Event ID 4 from source PHP-7.0.13 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

php[11628]
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\Program Files (x86)\PHP7\ext\php_imagick.dll' - The specified module could not be found.
 ("d:\Program Files (x86)\Apache24\bin\httpd.exe" -k runservice)

拜托,有人能告诉我,我做错了什么吗?

这是唯一对我有用的教程:

https://tektriks.com/a-step-by-step-guide-on-how-to-install-imagemagick-in-windows/

我在 Windows 7 下使用带有 WampServer64 的 PHP 版本 7.1.9。

按照给定教程中的步骤操作:

https://herbmiller.me/2016/06/16/installing-imagick-php-7/

我下载的文件是ImageMagick-6.9.3-7-vc14-x64.zip

http://windows.php.net/downloads/pecl/deps

将 ImageMagick 安装到您选择的目录

将整个 bin 目录从 ImageMagick zip 文件中提取到您选择的目录中。 我选择了 C:\\ImageMagick-6.9.3-7

然后设置系统环境变量并重新启动。

按照https://mlocati.github.io/articles/php-windows-imagick.html上的说明进行操作

本质上:

  1. 下载和解压两个 ZIP 文件
  2. 将一些文件复制到 PHP 安装中
  3. 更改 php.ini
  4. 重新启动网络服务器

这一步对我来说非常有效。 首先,从下面的链接下载。

- 在 Windows 中安装 ImageMagick PHP 扩展

在此处输入图片说明

  • 从 php_imagick-....zip 解压到你的 PHP 安装的 php_imagick.dll 文件的 ext 目录
  • 从 ImageMagick-....zip 解压到 PHP 根目录(php.exe 所在的位置)以(并且有一个 TON)开头的 DLL 文件:

    核心_RL_

    IM_MOD_RL_

将此行添加到您的 php.ini 文件中

extension=imagick

然后运行一个简单的测试(应该输出一个 1):

php -r "print(class_exists('imagick'));"


参考资料:

https://github.com/Imagick/imagick/issues/224#issuecomment-367532736

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM