在WAMP上安装IMAGEMAGICK的逐步说明?

时间:2022-10-08 16:32:22

There don't seem to be any concise tutorials/walk throughs for installing ImageMagick on WAMP for use with PHP.

在WAMP上安装ImageMagick并与PHP一起使用时,似乎没有任何简明的教程/走查。

I've tried dozens of combinations of their binary releases with different php extension dll files. I can get imagemagick working fine from the command line, and I can get it to show as ticked in the WAMP extensions, but can't actually use it.

我已经尝试了许多不同的php扩展dll文件的二进制版本的组合。我可以让imagemagick在命令行中正常工作,也可以让它在WAMP扩展中显示为勾,但实际上不能使用它。

Has anyone come across a good guide for installing this ball ache piece of software?

有没有人遇到过安装这个球疼软件的好指南?

I've followed http://www.knowledge-transfers.com/it/installing-imagemagick-on-windows-setup-imagick-on-php with no luck...

我跟踪了http://www.knowledge-transfers.com/it/installing-imagemagick-windowssetup - imagick-onphp,运气不好…


Update: this is what happens when I follow the steps in PHP farmer's answer on windows7. My php.ini is setup as follows:

更新:当我按照PHP farmer对windows7的回答中的步骤操作时,会发生这种情况。我的php。ini的设置如下:

extension_dir = "c:/wamp/bin/php/php5.3.0/ext/"

extension=php_imagick.dll

I reboot and get these two errors in this order

我重新启动并在这个顺序中得到这两个错误。

在WAMP上安装IMAGEMAGICK的逐步说明?在WAMP上安装IMAGEMAGICK的逐步说明?

and here is the dll file where it should be:

这是dll文件,应该在这里:

在WAMP上安装IMAGEMAGICK的逐步说明?

7 个解决方案

#1


63  

I know this is old post but I spend my all day to make it work, so here are the steps that helped me:

我知道这是一篇很老的文章,但我花了一整天的时间让它发挥作用,所以以下是帮助我的步骤:

  1. Download ImageMagick Binary Release - http://www.imagemagick.org/script/download.php
  2. 下载ImageMagick二进制版本- http://www.imagemagick.org/script/download.php
  3. Install in C:\imagemagick, on last step check "Add application directory to your system path"
  4. 安装在C:\imagemagick,最后一步检查“将应用程序目录添加到系统路径”
  5. Download Imagick DLL: PHP5.6.x version from http://www.peewit.fr/imagick/ (I have 5.6+ version installed on my localhost
  6. 下载Imagick DLL:PHP5.6。来自http://www.peewit.fr/imagick/的x版本(我在本地主机上安装了5.6+版本
  7. Copy php_imagick.dll to C:\wamp\bin\php\ext
  8. php_imagick副本。dll到C:\ wamp \ bin \ php \ ext
  9. Download PHP 5.6 Thread Safe (TS) x86 version from http://pecl.php.net/package/imagick/3.1.2/windows
  10. 从http://pecl.php.net/package/imagick/3.1.2/windows下载PHP 5.6 Thread Safe (TS) x86版本
  11. Copy CORE_RL_* files to C:\wamp\bin\apache\bin\
  12. 将CORE_RL_*文件复制到C:\wamp\bin\ bin\。
  13. Edit php.ini file in C:\wamp\bin\apache\bin\php.ini, add extension=php_imagick.dll line in extensions section
  14. 编辑php。ini文件C:\ wamp \ bin \ apache \ bin \ php。= php_imagick ini,添加扩展。扩展部分中的dll行
  15. Copy all files from C:\imagemagick\modules\coders and C:\imagemagick\modules\filters to C:\imagemagick to load ImageMagick supported formats
  16. 从C:\imagemagick\模块和C:\imagemagick\modules\过滤器到C:\imagemagick来加载imagemagick支持的格式
  17. Go to Control Panel -> System -> Advanced Settings -> Environment Variables -> New System Variable -> MAGICK_HOME = C:\imagemagick
  18. 转到控制面板->系统->高级设置->环境变量->新系统变量-> MAGICK_HOME = C:\imagemagick
  19. Restart Wamp server and check phpinfo() for imagick plugin
  20. 重新启动Wamp服务器并检查phpinfo()的imagick插件。
  21. If last step does not work, restart Windows
  22. 如果最后一步不起作用,重新启动Windows

#2


21  

I have improved fsasvari answer to cater general scenarios and versions. All credits to him.

我已经改进了fsasvari的答案,以适应一般的场景和版本。所有学分。

Install Imagick in WAMP

Imagick安装在里面

  1. Open your phpinfo() page
  2. 打开你的phpinfo()页
  3. Check the below
    PHP version (mine : 5.5.12)
    Compiler (mine : MSVC11 (Visual C++ 2012) )
    Architecture : (mine : x64)
    Thread Safety : enabled
    Loaded Configuration File (mine : C:\wamp\bin\apache\apache2.4.9\bin\php.ini)
    extension_dir : (mine : c:/wamp/bin/php/php5.5.12/ext/)
    Apache Bin (Not in phpinfo() page) : C:\wamp\bin\apache\apache2.4.9\bin\

    查看下面的PHP版本(mine: 5.5.12)编译器(mine: MSVC11 (Visual C++ 2012))架构:(mine: x64)线程安全:启用的配置文件

  4. Get the latest release match to your architecture from here (for me it was ImageMagick-x86_64-pc-windows.exe).

    从这里获取与您的架构的最新版本匹配(对我来说是ImageMagick-x86_64-pc-windows.exe)。

  5. Copy all files from C:\imagemagick\modules\coders and C:\imagemagick\modules\filters to C:\imagemagick to load ImageMagick supported formats

    从C:\imagemagick\模块和C:\imagemagick\modules\过滤器到C:\imagemagick来加载imagemagick支持的格式

  6. Install in C:\imagemagick, on last step check "Add application directory to your system path"

    安装在C:\imagemagick,最后一步检查“将应用程序目录添加到系统路径”

  7. Download the PECL matching to your architecture http://pecl.php.net/package/imagick/3.1.2/windows (for me : 5.5 Thread Safe (TS) x64)

    下载匹配您的体系结构的PECL http://pecl.php.net/package/imagick/3.1.2/windows(对我来说:5.5线程安全(TS) x64)

  8. Extract it and copy all the CORE_RL_* files to apache bin folder (mine : C:\wamp\bin\apache\apache2.4.9\bin)

    提取它并将所有CORE_RL_*文件复制到apache bin文件夹(我的文件夹:C:\wamp\bin\apache\apache2.4.9\bin)

  9. Copy php_imagick.* files to extension dir (mine : c:/wamp/bin/php/php5.5.12/ext/)

    php_imagick副本。*扩展目录的文件(我的:c:/wamp/bin/php/php5.5.12/ext/)

  10. Edit php.ini file (mine : C:\wamp\bin\apache\apache2.4.9\bin\php.ini)
    add extension=php_imagick.dll line in extensions section

    编辑php。ini文件(我的:C:\wamp\bin\ apache2.4.9\ php.i) add extension=php_imagick。扩展部分中的dll行

  11. Go to Control Panel -> System -> Advanced Settings -> Environment Variables -> New System Variable -> MAGICK_HOME = C:\imagemagick

    转到控制面板->系统->高级设置->环境变量->新系统变量-> MAGICK_HOME = C:\imagemagick

  12. Restart Wamp server and check phpinfo() for imagick plugin

    重新启动Wamp服务器并检查phpinfo()中的imagick插件

  13. If last step does not work, restart Windows (Specially if you have previously installed imagemagick in different folder/version)

    如果最后一步不起作用,重新启动Windows(特别是如果您之前在不同的文件夹/版本中安装了imagemagick)

#3


3  

PHP 5.4 php_imagick.dll is here: http://www.peewit.fr/imagick/ . I read somewhere that 64bit php doesnt work with php_imagick. That might be the case when you get this error in apache_error.log

PHP 5.4 php_imagick。dll在这里:http://www.peewit.fr/imagick/。我在某个地方读到64位php不能使用php_imagick。当您在apache_error.log中得到这个错误时,可能会出现这种情况

PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' -
%1 is not a valid Win32 application.\r\n in Unknown on line 0

As mentioned above, it was also necessary to add this into httpd.conf (also, i read you cant have spaces/dashes/dots):

如上所述,还需要将其添加到httpd中。conf(我也读到你不能有空格/破折号/点):

SetEnv MAGICK_HOME C:/imagemagick"

If you dont, you might get this error:

如果你不这样做,你可能会得到这个错误:

"PHP Warning:  PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' -
The specified procedure could not be found. in Unknown on line 0"

In the end, this article might partially help: http://www.elxsy.com/2009/07/installing-imagemagick-on-windows-and-using-with-php-imagick/

最后,本文可能对本文有所帮助:http://www.elxsy.com/2009/07/installing-imagemagick-on-window - use -with-php-imagick/

#4


3  

This was a headache for me as well, but unfortunately I installed this quite awhile ago. The instructions from that link you posted seem accurate. Have you ran phpinfo(); to see if it is installed in the Apache Environment? It should be listed as MAGICK_HOME.

这也让我头疼,但不幸的是,我在一段时间之前安装了这个。你发布的链接上的说明似乎是正确的。你跑phpinfo();查看它是否安装在Apache环境中?它应该被列为MAGICK_HOME。

Make sure "SetEnv MAGICK_HOME C:/imagemagick" is set at the end of your httpd.conf file. Assuming imagemagick is installed in that directory.

确保“SetEnv MAGICK_HOME C:/imagemagick”设置在httpd末尾。conf文件。假设imagemagick安装在那个目录中。

Be sure that you have the extension "php_imagick.dll" in your php.ini file as well.

确保您有扩展名“php_imagick”。在php dll”。ini文件。

It should work just fine if you have all those set.

如果你有这些集合,它就会很好。

On another note, here is a nice little library someone built to make imagick easier to use. https://github.com/francodacosta/phmagick

另一个注意事项是,这里有一个很好的小库,用来让imagick更容易使用。https://github.com/francodacosta/phmagick

I hope that helps! Good luck!

我希望会有帮助!好运!

#5


1  

I've never used WAMP but I have found that sometimes installing PHP extensions on Windows I need to ensure that any dll's that the extension relies on is in the Windows system PATH. If there is more than the one dll packaged with the imagemagick extension, try adding the directory that the dll's reside in to the Windows system PATH then REBOOT (to ensure that the web server gets a copy of the NEW environment).

我从未使用过WAMP,但我发现有时我需要在Windows上安装PHP扩展,以确保扩展所依赖的任何dll都位于Windows系统路径中。如果附带imagemagick扩展的dll不止一个,那么尝试将dll所在的目录添加到Windows系统路径中,然后重新启动(以确保web服务器获得新环境的副本)。

#6


1  

I know this is an old question but i guess this will help someone someday out there....

我知道这是一个老问题,但我猜这总有一天会帮助别人....

If you are on WAMPP and have PHP 5.4.x installed , go here http://www.peewit.fr/imagick/

如果您在WAMPP上,并且有PHP 5.4。已安装,请访问http://www.peewit.fr/imagick/

and download appropriate files as instructed. It will work.

并按指示下载适当的文件。它将工作。

#7


0  

Please see this answer already on *:

请在*上看到这个答案:

Installing ImageMagick extension with php/windows

使用php/windows安装ImageMagick扩展

I answered this question some time ago. This solves the DLL mismatch error.

我不久前回答了这个问题。这解决了DLL错配错误。

#1


63  

I know this is old post but I spend my all day to make it work, so here are the steps that helped me:

我知道这是一篇很老的文章,但我花了一整天的时间让它发挥作用,所以以下是帮助我的步骤:

  1. Download ImageMagick Binary Release - http://www.imagemagick.org/script/download.php
  2. 下载ImageMagick二进制版本- http://www.imagemagick.org/script/download.php
  3. Install in C:\imagemagick, on last step check "Add application directory to your system path"
  4. 安装在C:\imagemagick,最后一步检查“将应用程序目录添加到系统路径”
  5. Download Imagick DLL: PHP5.6.x version from http://www.peewit.fr/imagick/ (I have 5.6+ version installed on my localhost
  6. 下载Imagick DLL:PHP5.6。来自http://www.peewit.fr/imagick/的x版本(我在本地主机上安装了5.6+版本
  7. Copy php_imagick.dll to C:\wamp\bin\php\ext
  8. php_imagick副本。dll到C:\ wamp \ bin \ php \ ext
  9. Download PHP 5.6 Thread Safe (TS) x86 version from http://pecl.php.net/package/imagick/3.1.2/windows
  10. 从http://pecl.php.net/package/imagick/3.1.2/windows下载PHP 5.6 Thread Safe (TS) x86版本
  11. Copy CORE_RL_* files to C:\wamp\bin\apache\bin\
  12. 将CORE_RL_*文件复制到C:\wamp\bin\ bin\。
  13. Edit php.ini file in C:\wamp\bin\apache\bin\php.ini, add extension=php_imagick.dll line in extensions section
  14. 编辑php。ini文件C:\ wamp \ bin \ apache \ bin \ php。= php_imagick ini,添加扩展。扩展部分中的dll行
  15. Copy all files from C:\imagemagick\modules\coders and C:\imagemagick\modules\filters to C:\imagemagick to load ImageMagick supported formats
  16. 从C:\imagemagick\模块和C:\imagemagick\modules\过滤器到C:\imagemagick来加载imagemagick支持的格式
  17. Go to Control Panel -> System -> Advanced Settings -> Environment Variables -> New System Variable -> MAGICK_HOME = C:\imagemagick
  18. 转到控制面板->系统->高级设置->环境变量->新系统变量-> MAGICK_HOME = C:\imagemagick
  19. Restart Wamp server and check phpinfo() for imagick plugin
  20. 重新启动Wamp服务器并检查phpinfo()的imagick插件。
  21. If last step does not work, restart Windows
  22. 如果最后一步不起作用,重新启动Windows

#2


21  

I have improved fsasvari answer to cater general scenarios and versions. All credits to him.

我已经改进了fsasvari的答案,以适应一般的场景和版本。所有学分。

Install Imagick in WAMP

Imagick安装在里面

  1. Open your phpinfo() page
  2. 打开你的phpinfo()页
  3. Check the below
    PHP version (mine : 5.5.12)
    Compiler (mine : MSVC11 (Visual C++ 2012) )
    Architecture : (mine : x64)
    Thread Safety : enabled
    Loaded Configuration File (mine : C:\wamp\bin\apache\apache2.4.9\bin\php.ini)
    extension_dir : (mine : c:/wamp/bin/php/php5.5.12/ext/)
    Apache Bin (Not in phpinfo() page) : C:\wamp\bin\apache\apache2.4.9\bin\

    查看下面的PHP版本(mine: 5.5.12)编译器(mine: MSVC11 (Visual C++ 2012))架构:(mine: x64)线程安全:启用的配置文件

  4. Get the latest release match to your architecture from here (for me it was ImageMagick-x86_64-pc-windows.exe).

    从这里获取与您的架构的最新版本匹配(对我来说是ImageMagick-x86_64-pc-windows.exe)。

  5. Copy all files from C:\imagemagick\modules\coders and C:\imagemagick\modules\filters to C:\imagemagick to load ImageMagick supported formats

    从C:\imagemagick\模块和C:\imagemagick\modules\过滤器到C:\imagemagick来加载imagemagick支持的格式

  6. Install in C:\imagemagick, on last step check "Add application directory to your system path"

    安装在C:\imagemagick,最后一步检查“将应用程序目录添加到系统路径”

  7. Download the PECL matching to your architecture http://pecl.php.net/package/imagick/3.1.2/windows (for me : 5.5 Thread Safe (TS) x64)

    下载匹配您的体系结构的PECL http://pecl.php.net/package/imagick/3.1.2/windows(对我来说:5.5线程安全(TS) x64)

  8. Extract it and copy all the CORE_RL_* files to apache bin folder (mine : C:\wamp\bin\apache\apache2.4.9\bin)

    提取它并将所有CORE_RL_*文件复制到apache bin文件夹(我的文件夹:C:\wamp\bin\apache\apache2.4.9\bin)

  9. Copy php_imagick.* files to extension dir (mine : c:/wamp/bin/php/php5.5.12/ext/)

    php_imagick副本。*扩展目录的文件(我的:c:/wamp/bin/php/php5.5.12/ext/)

  10. Edit php.ini file (mine : C:\wamp\bin\apache\apache2.4.9\bin\php.ini)
    add extension=php_imagick.dll line in extensions section

    编辑php。ini文件(我的:C:\wamp\bin\ apache2.4.9\ php.i) add extension=php_imagick。扩展部分中的dll行

  11. Go to Control Panel -> System -> Advanced Settings -> Environment Variables -> New System Variable -> MAGICK_HOME = C:\imagemagick

    转到控制面板->系统->高级设置->环境变量->新系统变量-> MAGICK_HOME = C:\imagemagick

  12. Restart Wamp server and check phpinfo() for imagick plugin

    重新启动Wamp服务器并检查phpinfo()中的imagick插件

  13. If last step does not work, restart Windows (Specially if you have previously installed imagemagick in different folder/version)

    如果最后一步不起作用,重新启动Windows(特别是如果您之前在不同的文件夹/版本中安装了imagemagick)

#3


3  

PHP 5.4 php_imagick.dll is here: http://www.peewit.fr/imagick/ . I read somewhere that 64bit php doesnt work with php_imagick. That might be the case when you get this error in apache_error.log

PHP 5.4 php_imagick。dll在这里:http://www.peewit.fr/imagick/。我在某个地方读到64位php不能使用php_imagick。当您在apache_error.log中得到这个错误时,可能会出现这种情况

PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' -
%1 is not a valid Win32 application.\r\n in Unknown on line 0

As mentioned above, it was also necessary to add this into httpd.conf (also, i read you cant have spaces/dashes/dots):

如上所述,还需要将其添加到httpd中。conf(我也读到你不能有空格/破折号/点):

SetEnv MAGICK_HOME C:/imagemagick"

If you dont, you might get this error:

如果你不这样做,你可能会得到这个错误:

"PHP Warning:  PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' -
The specified procedure could not be found. in Unknown on line 0"

In the end, this article might partially help: http://www.elxsy.com/2009/07/installing-imagemagick-on-windows-and-using-with-php-imagick/

最后,本文可能对本文有所帮助:http://www.elxsy.com/2009/07/installing-imagemagick-on-window - use -with-php-imagick/

#4


3  

This was a headache for me as well, but unfortunately I installed this quite awhile ago. The instructions from that link you posted seem accurate. Have you ran phpinfo(); to see if it is installed in the Apache Environment? It should be listed as MAGICK_HOME.

这也让我头疼,但不幸的是,我在一段时间之前安装了这个。你发布的链接上的说明似乎是正确的。你跑phpinfo();查看它是否安装在Apache环境中?它应该被列为MAGICK_HOME。

Make sure "SetEnv MAGICK_HOME C:/imagemagick" is set at the end of your httpd.conf file. Assuming imagemagick is installed in that directory.

确保“SetEnv MAGICK_HOME C:/imagemagick”设置在httpd末尾。conf文件。假设imagemagick安装在那个目录中。

Be sure that you have the extension "php_imagick.dll" in your php.ini file as well.

确保您有扩展名“php_imagick”。在php dll”。ini文件。

It should work just fine if you have all those set.

如果你有这些集合,它就会很好。

On another note, here is a nice little library someone built to make imagick easier to use. https://github.com/francodacosta/phmagick

另一个注意事项是,这里有一个很好的小库,用来让imagick更容易使用。https://github.com/francodacosta/phmagick

I hope that helps! Good luck!

我希望会有帮助!好运!

#5


1  

I've never used WAMP but I have found that sometimes installing PHP extensions on Windows I need to ensure that any dll's that the extension relies on is in the Windows system PATH. If there is more than the one dll packaged with the imagemagick extension, try adding the directory that the dll's reside in to the Windows system PATH then REBOOT (to ensure that the web server gets a copy of the NEW environment).

我从未使用过WAMP,但我发现有时我需要在Windows上安装PHP扩展,以确保扩展所依赖的任何dll都位于Windows系统路径中。如果附带imagemagick扩展的dll不止一个,那么尝试将dll所在的目录添加到Windows系统路径中,然后重新启动(以确保web服务器获得新环境的副本)。

#6


1  

I know this is an old question but i guess this will help someone someday out there....

我知道这是一个老问题,但我猜这总有一天会帮助别人....

If you are on WAMPP and have PHP 5.4.x installed , go here http://www.peewit.fr/imagick/

如果您在WAMPP上,并且有PHP 5.4。已安装,请访问http://www.peewit.fr/imagick/

and download appropriate files as instructed. It will work.

并按指示下载适当的文件。它将工作。

#7


0  

Please see this answer already on *:

请在*上看到这个答案:

Installing ImageMagick extension with php/windows

使用php/windows安装ImageMagick扩展

I answered this question some time ago. This solves the DLL mismatch error.

我不久前回答了这个问题。这解决了DLL错配错误。