无法加载imagick库 [英] Cannot load imagick library

查看:590
本文介绍了无法加载imagick库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从此处(ImageMagick-7.0.3- 1-Q16-x64-dll)和此处.并且将CORE_RL_*复制到C:\xampp\apache\bin但在运行laravel服务器时仍然出现以下错误.

I have installed the imagick from here (ImageMagick-7.0.3-1-Q16-x64-dll) and the dll (TS 32 bit) from here. And also copiend the CORE_RL_* to the C:\xampp\apache\bin BUT still i get the following error when i run the laravel server.

错误:警告:PHP启动:无法加载动态库'C:\ xampp \ php \ ext \ php_imagick.dll'-找不到指定的模块. 在第0行上的未知"中

ERROR: Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_imagick.dll' - The specified module could not be found. in Unknown on line 0

此外,我将dll文件放置在C:\xampp\php\ext\php_imagick.dll中.

Also, I placed dll file in C:\xampp\php\ext\php_imagick.dll.

此外,imagick也显示在phpinfo()中.

Also, the imagick is shown in the phpinfo().

当我使用laravel使用它时,出现以下错误.

And when i use it using laravel i get the following error.

推荐答案

让Imagick在Windows上正常工作总是很容易碰到的,这里指出的这是一个很好的指导 http://stackoverflow.com/a/36378764/1090867

getting Imagick to work on windows has always been a bit hit and miss as pointed out here is a good guide http://stackoverflow.com/a/36378764/1090867

但是它错过了重要的一点

But it misses an important point

您不需要将二进制文件放入PHP文件夹!

You do not need to put the binary into the PHP folder!

因此,这是我每次需要执行的操作步骤.这应该适用于apache,nginx或IIS.

So here are the steps I follow myself everytime I need to do this. This should work for apache, nginx or IIS.

找出您的php版本和设置

find out your php version and setting

您需要版本,体系结构,编译器和线程安全性

You need to version, Architecture, Compiler and Thread Safety

如果禁用了线程安全,则启用了 NTS ,它将 TS

if Thread Safety is disabled this is NTS is enabled it will TS

获取一份imageMagick的安装包,只需确保它与您的体系结构匹配即可,这也需要是dll.exe而不是静态版本.

Get an install a copy of imageMagick it just make sure it mataches your Architecture, this also needs to be dll.exe rather that the static version.

关于第8季度和第16季度,我会留给您,但两个版本都可以使用

Regarding Q8 and Q16 I'll leave that you to you but both versions will work

http://www.imagemagick.org/script/binary-releases. php#windows

我建议将安装目录名称更改为通用名称,例如 C:\Imagemagick,因为我过去在使用PHP和Windows的默认目录名称时遇到了一些问题.

I recommend changing the install directory name to something geneeric like C:\Imagemagick since I've had some problems in the past with te default directory name with PHP and windows.

只需安装,但请确保您选中添加应用程序路径,并且我通常也选中旧版实用程序.

Just install but make sure you tick add application path and I normally tick the legacy utils as well.

安装完成后,转到您的环境变量,并确保它实际上在路径中. 无需将任何内容复制到您的php文件夹

Once its install go to your environment variables and make sure it is actually in the path. There is no need to copy anything to your php folder

只要确保一切正常,请打开命令行并输入convert --version,您应该得到响应

Just to make sure everything is working open the command line and type convert --version you should get a reponse

不幸的是,这是困难的部分,可能会反复试验.我发现以下内容提供了最好的php_imagick.dll,它似乎可以工作10次中的9次

This unfortantly is the hard part and can be a bit of trial and error. I've found the following provides the best php_imagick.dll that seems to work 9 times out of 10

http://www.peewit.fr/imagick/

只需选择与您的安装匹配的版本即可.

Just pick the version that matches your install.

如果这不起作用,请转到php.net并尝试每个版本,直到一个可用为止(最晚开始)

If this doesn't work then go to php.net and try each version until one works... (start at the latest)

http://windows.php.net/downloads/pecl/releases/imagick /

一旦您有了php_imagick.dll,将其放入您的php/ext/文件夹

Once you have a php_imagick.dll put it into your php/ext/ folder

找到php.ini文件的底部(或扩展名所在的位置)并添加extension=php_imagick.dll

thne locate your php.ini file go to the bottom (or whereever your extensions are) and add extension=php_imagick.dll

重新启动PHP(或您的计算机),如果不尝试其他php_imagick.dll并重复该操作,它将正常工作.

Restart PHP (or your computer) and it should be working if not try a different php_imagick.dll and repeat.

然后尝试使用稍旧的imagick版本,我通常使用版本6.8.6-8 Q16.

Then try a slightly older version of imagick I normally use version 6.8.6-8 Q16.

请注意,只有在Windows 7和Windows Server 2008、2008 R2、2012和2012 R2上,所有真正使用过x64 php的x64才真正做到这一点

Please note I've only every really done this on Windows 7 and Windows Server 2008, 2008 R2, 2012 and 2012 R2 all x64 with x86 php

如果这仍然不起作用,那么您可能需要将CORE_RL文件复制到imagick目录中,这通常会导致更多问题,但是如果您的想法不足,请尝试一下

If this still doesn't work then you probably need to copy over the CORE_RL files into your imagick directory this normally causes more issues but if you are running out idea then give it a go

这篇关于无法加载imagick库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆