php ImageMagick 支持的格式没有价值

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15279301/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 08:58:09  来源:igfitidea点击:

ImageMagick supported formats no value

phpwindowsimagemagick

提问by anoop

I have installed download and install ImageMagick-6.8.3-7-Q16-x86-dll.exefrom the link http://imagemagick.org/script/binary-releases.php#windowsand I am using Windows 7 and PHP 5.3.8.

我已经ImageMagick-6.8.3-7-Q16-x86-dll.exe从链接下载并安装http://imagemagick.org/script/binary-releases.php#windows,我使用的是 Windows 7 和 PHP 5.3.8。

When in install this it got installed correctly in my machine and convertcommands works perfectly. On my convert config what shows is here:

安装时,它在我的机器上正确安装,convert命令完美运行。在我的转换配置什么节目是在这里

enter image description here

在此处输入图片说明

But on my phpinfo section I get:

但在我的 phpinfo 部分我得到:

ImageMagick supported formats has no value

ImageMagick 支持的格式没有价值

I got all the image magick values like this https://www.evernote.com/shard/s297/sh/12397c86-d016-4ca4-9415-fd541daeca39/2fc504bf5ddba5693efd3249402b2b5c.

我得到了像这样的所有图像魔法值https://www.evernote.com/shard/s297/sh/12397c86-d016-4ca4-9415-fd541daeca39/2fc504bf5ddba5693efd3249402b2b5c

I don't know why it is getting as no value i have installed the same ImageMagick-6.8.3-7-Q16-x86-dll.exe on php 5.3.8 in my 32 bit windows7 machine . The php_imagick.dlli downloded from other website. I don't know what is the issue i am having in install imagemaagick, if it is the issue with php_imagick.dllversion can anybody suggest proper php_imagick version for this configuration?

我不知道为什么它没有价值,我在 32 位 windows7 机器上的 php 5.3.8 上安装了相同的 ImageMagick-6.8.3-7-Q16-x86-dll.exe。在php_imagick.dll我从其他网站downloded。我不知道我在安装 imagemaagick 时遇到了什么问题,如果是php_imagick.dll版本问题,有人可以为此配置建议合适的 php_imagick 版本吗?

回答by klerigo

I have spent several days looking for a solution, and I finally found it with Sysinternals procmon.

找了好几天的解决办法,终于用Sysinternals procmon找到了。

I found out apache was looking for dll files like IM_MOD_xxxx.dll in folders c:\windows\system and /bin. Copying the files to one of those folders did the trick to me.

我发现 apache 正在文件夹 c:\windows\system 和 /bin 中寻找像 IM_MOD_xxxx.dll 这样的 dll 文件。将文件复制到这些文件夹之一对我有用。

Cood luck.

祝你好运。

回答by Jorr.it

Not all versions of ImageMagick will work with all versions of php_imagick.dll. The Imagick extension v3.4.* in combination with ImageMagick 7.* gave no support for any image format. When I downgraded to ImageMagick 6.9.* the problem was solved.

并非所有版本的 ImageMagick 都适用于所有版本的 php_imagick.dll。Imagick 扩展 v3.4.* 结合 ImageMagick 7.* 不支持任何图像格式。当我降级到 ImageMagick 6.9.* 时,问题就解决了。

On an echo of phpinfo you can see which version of ImageMagick is needed. Search for "Imagick using ImageMagick library version" and "Imagick compiled with ImageMagick version" (which should be equal).

在 phpinfo 的回声中,您可以看到需要哪个版本的 ImageMagick。搜索“使用 ImageMagick 库版本的 Imagick”和“使用 ImageMagick 版本编译的 Imagick”(应该相等)。

List of binary downloads: https://www.imagemagick.org/download/binaries/

二进制下载列表:https: //www.imagemagick.org/download/binaries/

Or older versions: http://windows.php.net/downloads/pecl/deps/

或旧版本:http: //windows.php.net/downloads/pecl/deps/

Step by step instructions for installing ImageMagick on Windows: https://stackoverflow.com/a/28872879/2366136

在 Windows 上安装 ImageMagick 的分步说明:https: //stackoverflow.com/a/28872879/2366136

回答by FDIM

Since its first result on google when looking for solution to this issue I'll add one that worked for me. Source: http://forums.zend.com/viewtopic.php?t=2397#p15226

由于它在寻找此问题的解决方案时在 google 上的第一个结果,我将添加一个对我有用的结果。来源:http: //forums.zend.com/viewtopic.php?t=2397#p15226

I was having issues with PHP 5.6, it recognized the extension but no formats were supported. (http://windows.php.net/downloads/pecl/releases/imagick/3.1.2/)

我在使用 PHP 5.6 时遇到问题,它可以识别扩展名,但不支持任何格式。( http://windows.php.net/downloads/pecl/releases/imagick/3.1.2/)

Installing latest version of imagemagick(with dynamic libs) and copying DLL files from imagemagickDir/modules/coders/* and imagemagickDir/modules/filters/* to imagemagick root helped, now imagemagick works properly from when calling php.

安装最新版本的 imagemagick(带有动态库)并将 DLL 文件从 imagemagickDir/modules/coders/* 和 imagemagickDir/modules/filters/* 复制到 imagemagick root 有帮助,现在 imagemagick 在调用 php 时可以正常工作。

Don't forget to give IIS access to imagemagick folder.

不要忘记授予 IIS 访问 imagemagick 文件夹的权限。

EDIT:

编辑:

When IIS successfully recognized formats, I ran into compatibility issues.

当 IIS 成功识别格式时,我遇到了兼容性问题。

Working combo for PHP 5.6:

PHP 5.6 的工作组合:

http://windows.php.net/downloads/pecl/releases/imagick/3.2.0b2/
http://ftp.icm.edu.pl/packages/ImageMagick/binaries/ImageMagick-6.8.8-9-Q16-x86-dll.exe

http://windows.php.net/downloads/pecl/releases/imagick/3.2.0b2/
http://ftp.icm.edu.pl/packages/ImageMagick/binaries/ImageMagick-6.8.8-9-Q16- x86-dll.exe

回答by phamuc

Check that

检查一下

MAGICK_HOME=C:\Program Files (x86)\ImageMagick-6.8.8-Q16\modules\coders

MAGICK_HOME=C:\Program Files (x86)\ImageMagick-6.8.8-Q16\modules\coders

is set.

设置。

回答by Spencer Williams

There are a lot of answers out there, as the landscape for this program and PHP have changed over time.

有很多答案,因为这个程序和 PHP 的格局随着时间的推移而发生了变化。

I am so cutting edge as to be using PHP 7.1 at the moment. At first I was copying DLLs all over the place like all of the instructions have you do. Luckily, all that is necessary is the latest PECL package and the corresponding version of Imagick for your system, which was the tricky part. You can't used the latest Imagick (version 7 at the time of writing this) if you want to use the PHP extension, until the extension is upgraded. You have to install a version of Imagick on your system that matches the PHP extension version.

我现在使用 PHP 7.1 非常前沿。起初,我像所有指令一样到处复制 DLL。幸运的是,所有需要的是最新的 PECL 包和适用于您系统的相应版本的 Imagick,这是棘手的部分。如果您想使用 PHP 扩展,则不能使用最新的 Imagick(撰写本文时的版本 7),直到扩展升级。您必须在系统上安装与 PHP 扩展版本匹配的 Imagick 版本。

As others have instructed, download the latest PECL package for imagickfor your PHP version. Since I'm using the thread-safe x64 version of PHP 7.1, I want the 3.4.3RC1 package, the only one with a DLL for my version of PHP at this time.

按照其他人的指示,下载适用于您的 PHP 版本的imagick 的最新 PECL 包。因为我使用的是 PHP 7.1 的线程安全 x64 版本,所以我想要 3.4.3RC1 包,这是目前唯一一个带有我的 PHP 版本的 DLL 的包。

Of these files, I only need to copy over php_imagick.dll. Next, head over to http://windows.php.net/downloads/pecl/deps/and download the latest Imagick for your system which is probably going to be the VC14 one at this point, for which it seems just a matter of installing the corresponding C++ Redistributable package on your system for it to work. Simply unzip the files and add the bin to your path. Again, if you have a newer version of Imagick, you'll want to replace it with this one because this is the one that will work with the php extension.

在这些文件中,我只需要复制php_imagick.dll. 接下来,前往http://windows.php.net/downloads/pecl/deps/并为您的系统下载最新的 Imagick,此时它可能是 VC14 的,这似乎只是一个问题在您的系统上安装相应的 C++ Redistributable 包以使其正常工作。只需解压缩文件并将 bin 添加到您的路径中。同样,如果您有较新版本的 Imagick,您需要将其替换为这个版本,因为这是一个适用于 php 扩展的版本。

At this point, you should be able to restart apache and confirm that the imagick extension is enabled in the phpinfo. It should show you the version of Imagick for the PHP extension. Again, if the Imagick on your system in your path is a version that matches what is shown for the PHP extension, then you should see the list of supported formats that it is getting from the DLLs from the version 6 Imagick on your system. You will not need to copy them to apache bin or anywhere else, nor make a MAGICK_HOME folder.

此时,您应该可以重新启动 apache 并确认 phpinfo 中启用了 imagick 扩展。它应该向您显示 PHP 扩展的 Imagick 版本。同样,如果您路径中系统上的 Imagick 版本与为 PHP 扩展显示的版本相匹配,那么您应该看到它从系统上版本 6 Imagick 的 DLL 中获取的支持格式列表。您不需要将它们复制到 apache bin 或其他任何地方,也不需要创建 MAGICK_HOME 文件夹。

回答by Codesmith

I had the same problem, and tried everything. You do notneed - as I thought - ImageMagick installed on your system to run the Imagick module for PHP. You simply need to make sure you include both the CORE_RL_*dlls as well asthe IM_MOD_*dlls in the apache/bindirectory, and then also the php_imagick.dll in the php/extdirectory.

我有同样的问题,并尝试了一切。你并不需要-因为我想-你的系统运行PHP的Imagick模块上安装ImageMagick的。你只需要确保你既包括CORE_RL_*dll文件,以及IM_MOD_*在的dllapache/bin目录下,然后又在该php_imagick.dllphp/ext目录。

I'm running PHP 7.0.25 x86 via XAMPP on Windows, and these instructions were incredibly simple and helpful:

我在 Windows 上通过 XAMPP 运行 PHP 7.0.25 x86,这些说明非常简单和有用:

https://mlocati.github.io/articles/php-windows-imagick.html

https://mlocati.github.io/articles/php-windows-imagick.html

回答by NS Naidu

Even after installing imagick & imagemagick correctly, if it is not working, please check your Apache Environment PATH Variable. Most probably if the path variable is not showing your ImageMagick inatallation folder, please add that into windows advanced system settings/environment variables/system variables -> PATH.

即使在正确安装 imagick 和 imagemagick 之后,如果它不起作用,请检查您的 Apache 环境路径变量。很可能如果路径变量没有显示您的 ImageMagick inatallation 文件夹,请将其添加到 Windows 高级系统设置/环境变量/系统变量 -> PATH。

Restart WAMP server and check to see the phponfo for Apache Environment PATH Variable.

重新启动 WAMP 服务器并检查以查看 Apache 环境路径变量的 phponfo。

回答by R Carey

I searched posts and tried various suggestions - for several hours. I did not attain success until I tried the steps here: https://mlocati.github.io/articles/php-windows-imagick.html(as posted by Codesmith- and I agree the steps are short, easy-to-follow). My need was to install on WAMP.

我搜索了帖子并尝试了各种建议 - 几个小时。直到我尝试了这里的步骤,我才成功:https: //mlocati.github.io/articles/php-windows-imagick.html(由Codesmith发布- 我同意这些步骤很短,易于遵循)。我的需要是安装在 WAMP 上。

The page behind this link tells how to determine the correct version to download of Imagickand ImageMagick. Just extract three sets of files to stated directories, make a change in php.ini, and restart WAMP. My code uses only JPEG and PNG formats, so of the format-based DLLs, I moved only those.

此链接后面的页面介绍了如何确定下载ImagickImageMagick的正确版本。只需将三组文件提取到指定目录,在php.ini 中进行更改,然后重新启动 WAMP。我的代码仅使用 JPEG 和 PNG 格式,因此在基于格式的 DLL 中,我只移动了那些。