php 如何在 Windows 中的 xampp/wampp 中安装 imagick
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22390807/
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
How to install imagick in xampp/wampp in Windows
提问by Luciano Graziani
Today I have tried to install imagickin my xampp a hundred of times. And I did it. If you have troubles, please try following this steps:
今天我已经尝试imagick在我的 xampp 中安装一百次。我做到了。如果您遇到问题,请尝试按照以下步骤操作:
- Since xampp is x86, check if your Image Magick (the program) is x86. If not, download the lastest version here: imagemagick.org/script/binary-releases.php#windowsPlease remember that u MUST download the
Win32 dynamic at 16 bits-per-pixel. - Install Image Magick at
C:\imagemagick. - Download the lastest stable version of imagick here:. You MUST download the
5.x Thread Safe (TS) x86. The x in 5.x is the version of your PHP. - Put the
php_imagick.dllin php/ext folder of your xampp installation. - Add this in your php.ini:
extension=php_imagick.dll - Here is when i have a lot of troubles. If you try to start the server (or writing
phpin the console (start->cmd)), you will get an error. If that error says something like this:Unable to find the entry point for the procedure FlattenImages in the DLL CORE_RL_magick.dllit means that you're well under way. - Now, you must go into the installation folder of Image Magick and overwrite the DLL you downloaded with the
php_imagick.dll. All of they start with the prefixCORE_RL_. - Once you overwrited all of them, you can try writing
phpin the windows console. If dont say something means that the imagick is functionally (you can check inlocalhost/xampp/ > phpinfo() link. Personally i had to install a new DLL:vcomp110.dll. If someone have the same error than me (the system can't found thevcomp11.dd) download it here
- 由于 xampp 是 x86,请检查您的 Image Magick(程序)是否为 x86。如果没有,
请在此处下载最新版本:imagemagick.org/script/binary-releases.php#windows请记住,您必须下载
Win32 dynamic at 16 bits-per-pixel. - 安装 Image Magick
C:\imagemagick。 - 在此处下载 imagick 的最新稳定版本:. 您必须下载
5.x Thread Safe (TS) x86. 5.x 中的 x 是您的 PHP 版本。 - 将
php_imagick.dllxampp 安装的 php/ext 文件夹放入。 - 在你的 php.ini 中添加:
extension=php_imagick.dll - 这是我遇到很多麻烦的时候。如果您尝试启动服务器(或
php在控制台中写入(start->cmd)),则会出现错误。如果该错误说明如下:Unable to find the entry point for the procedure FlattenImages in the DLL CORE_RL_magick.dll这意味着您的工作进展顺利。 - 现在,您必须进入 Image Magick 的安装文件夹并用
php_imagick.dll. 它们都以前缀 开头CORE_RL_。 - 覆盖所有这些后,您可以尝试
php在 Windows 控制台中编写。如果不说一些东西意味着 imagick 是功能性的(你可以签入localhost/xampp/ > phpinfo() link。我个人必须安装一个新的 DLL :。vcomp110.dll如果有人和我有同样的错误(系统找不到vcomp11.dd),请在此处下载
Now, if you try excuting phpon console, or just initializing the apache module of xampp, you should not have errors.
现在,如果您尝试php在控制台上执行,或者只是初始化 xampp 的 apache 模块,您应该不会出错。
Good bye and hope I can help someone.
再见,希望我能帮助别人。
EDIT: when tried to convert some-img.bmp some-result.jpgin the console, i had this error:
convert.exe: unable to open module file 'C:\Users\my-acc\.magick\IM_MOD_RL_BMP_.dll': No such file or directory @ ...This happend when there are no folder .magickin my-acc. The thing you need to do is this:
编辑:当试图convert some-img.bmp some-result.jpg在控制台中,我有这个错误:
convert.exe: unable to open module file 'C:\Users\my-acc\.magick\IM_MOD_RL_BMP_.dll': No such file or directory @ ...当没有文件夹此happend.magick的my-acc。你需要做的是:
Create a folder named
.magickin themy-accfolder. Since the name starts with a stop, you need to create it through the console. Here are the commands:1.1.
c:1.2.
cd Users\my-acc1.3.
mkdir .magick- Go to
C:\imagemagick\modules\codersand copy the entire files into the lastest folder created.
在文件夹
.magick中创建一个文件my-acc夹。由于名称以停止开头,因此您需要通过控制台创建它。以下是命令:1.1.
c:1.2.
cd Users\my-acc1.3.
mkdir .magick- 转到
C:\imagemagick\modules\coders并将整个文件复制到最新创建的文件夹中。
Now, you will be able to use Image Magick through the commands or the PHP Classes.
现在,您将能够通过命令或 PHP 类使用 Image Magick。
On background, if you use Codeigniter, i have no idea how to use the image_lib with imagick. So, it's better with the own imagick classes. Here a simple example:
在后台,如果您使用 Codeigniter,我不知道如何将 image_lib 与 imagick 一起使用。所以,最好使用自己的 imagick 类。这里有一个简单的例子:
$image = new Imagick($upload_data['full_path']);
$image->thumbnailImage(250,0);
if($image->writeImage($upload_data['file_path'].$upload_data['raw_name'].'_thumb'.$upload_data['file_ext'])){
something here;
}
$image->clear();
回答by starlocke
This answer might be extremely naive, but, I've found that getting things done in Windows is generally too painful. Many people agree with that and have found solace in a tool known as "chocolatey".
这个答案可能非常天真,但是,我发现在 Windows 中完成工作通常太痛苦了。许多人同意这一点,并在一种称为“巧克力”的工具中找到了安慰。
First, install chocolatey on your Windows machine (super easy install instructions):
首先,在你的 Windows 机器上安装 Chocolatey(超级简单的安装说明):
Then, use chocolatey to install everything else that you need (imagemagick in this case):
然后,使用 Chocolatey 安装您需要的所有其他内容(在本例中为 imagemagick):
https://chocolatey.org/packages/imagemagick
https://chocolatey.org/packages/imagemagick
I suspect you might have to do some minor tweaking to configuration files after that, plus handle all of the "Windows permissions" needed to get things to work smoothly. Permissions are can be as simple (and not necessarily safe) as "full control" to some user, plus activating inheritance and overwriting all children's settings to use inheritance.
我怀疑在那之后您可能需要对配置文件进行一些小的调整,还要处理使事情顺利运行所需的所有“Windows 权限”。权限可以像对某些用户的“完全控制”一样简单(不一定安全),另外还可以激活继承并覆盖所有子项的设置以使用继承。
In short, install, configure, permissions, go.
总之,安装,配置,权限,去。
PS. This answer might be incomplete/prototypical/experimental, since I don't run codeigniter, php, imagemagick on Windows.
附注。这个答案可能不完整/原型/实验性,因为我不在 Windows 上运行 codeigniter、php、imagemagick。
回答by Jorr.it
This how-to of Winderfind is wonderful, but for me it was not yet complete to troubleshoot all problems. First of all, have a look at this tutorial: http://hrt0kmt.hatenablog.com/entry/2015/05/27/170608
Winderfind 的这个操作方法很棒,但对我来说还没有完成所有问题的故障排除。首先,看看这个教程:http: //hrt0kmt.hatenablog.com/entry/2015/05/27/170608
Secondly I discovered that not all versions of ImageMagick will work with all versions of php_imagick.dll. Check out my and others answers on this post for further troubleshooting: ImageMagick supported formats no value
其次,我发现并非所有版本的 ImageMagick 都适用于所有版本的 php_imagick.dll。在这篇文章中查看我和其他人的答案以进行进一步的故障排除: ImageMagick 支持的格式没有价值

