使用php / windows安装ImageMagick扩展 [英] Installing ImageMagick extension with php/windows

查看:146
本文介绍了使用php / windows安装ImageMagick扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在带有IIS的Windows Server 2003上运行PHP 5.2.5版。

Running PHP Version 5.2.5 on Windows Server 2003 with IIS.

实际上我们能够安装ImageMagick并且没有任何问题。它运行完全相同的PHP版本。使用以下步骤进行安装,但它似乎无法在此服务器上运行。 ImageMagick本身已安装,但php不会加载扩展名。

Have virtually an identical server where we were able to install ImageMagick with no issues. It's running exactly the same version of php. Used the following steps to install, but it just won't seem to work on this server. ImageMagick itself is installed but php won't load the extension.

我们花了好几个小时试图安装扩展程序。它只是不会出现在phpinfo()中。

We've spent hours trying to get the extension installed. It just won't show up in phpinfo().

安装步骤

在Windows XP上安装IMagick(PHP 5.2。 x)

To install IMagick on Windows XP (PHP 5.2.x)


  1. 下载并安装 ImageMagick-6.5.8-7 Q16-windows-dll.exe
    http://www.imagemagick.org/download/binaries/ImageMagick-6.5.8-7-Q16-windows-dll.exe


php_imagick_dyn-Q16.dll builds / 080709 /rel =noreferrer> http://valokuva.org/outside-blog-content/imagick-windows-builds/080709/

download php_imagick_dyn-Q16.dll from http://valokuva.org/outside-blog-content/imagick-windows-builds/080709/

将DLL复制到[PHP] / extension dir并将其重命名为 php_imagick.dll

copy DLL to [PHP]/extension dir and rename it to php_imagick.dll

你必须编辑你的 php.ini 文件并添加新的扩展名:

You have to edit your php.ini file and add the new extension:

extension=php_imagick.dll


  • 保存 php.ini 和resta rt Apache服务器。 (如有必要,重新启动Windows)

  • Save php.ini and restart Apache server. (If necessary, restart Windows)

    phpinfo()应显示 imagick 已启用。


    推荐答案

    找到非常有用的Buttercup给出的回答,如果他可以更清楚的话。

    Found very useful tha answer given by user Buttercup, also if he could be more clear.

    我的场景是Windows 2012 R2 x64,PHP 5.5.19 x64并需要安装带有PHP支持的ImageImagick。以下几点我可以安装ImageImagick 6.9.0 x64和PHP_Imagick.dll 3.1.2(目前都是最新的稳定版本)。

    My scenario was a Windows 2012 R2 x64, PHP 5.5.19 x64 and need to install ImageImagick with PHP support. Following points here below I was able to install ImageImagick 6.9.0 x64 and PHP_Imagick.dll 3.1.2 (both are currently the latest stable versions).

    请注意我已下载NTS和x64模式下的所有组件(PHP,ImageImagick和PHP_Imagick):不在TS和/或x86模式下。我不知道这是否适用于你自己的情况。

    Please note I downloaded all components (PHP, ImageImagick and PHP_Imagick) in NTS and x64 modes: not in TS and/or x86 modes. I don't know if this apply in your own case.

    我不清楚我是否读过Buttercup(就像用户RhoVisions一样)是他的评论: 覆盖从ImageMagick 6.8.8 Windows版本中找到的带有PHP版本的DLL。

    The point it wasn't clear for me reading the Buttercup (as for user RhoVisions) was his comment: "Overwrite the DLLs found from ImageMagick 6.8.8 Windows version with the PHP version".

    所以,这就是我所做的(基于Buttercup解决方案,我是谁)不得不一次又一次地说谢谢!):
    1)从 http://www.imagemagick.org/script/binary-releases.php#windows
    在我的情况下,我下载了第一个文件,名为Win64 dynamic at 16位/像素(文件名:ImageMagick-6.9.0-0-Q16-x64-dll.exe)

    So, this is what I've done (based on Buttercup solution, who I have to say again and again thank you very much!): 1) download latest ImageMagick EXE installer from http://www.imagemagick.org/script/binary-releases.php#windows In my case I downloaded the first file available as HTTP download labeled "Win64 dynamic at 16 bits-per-pixel" (filename: ImageMagick-6.9.0-0-Q16-x64-dll.exe)

    2)运行刚刚下载的安装程序。我将它安装在一个简单的路径中,如C:\ ImageMagick6.9.0(但我认为将它从程序文件中移除是如此重要)。此外,我在安装过程中没有更改其默认值中的任何其他参数。

    2) Run the installer just downloaded. I installed it in a simple path like C:\ImageMagick6.9.0 (but I don't think it is so important to move it away from Program Files). Also, I didn't change any other parameter from their defaults during installing.

    3)从PECL网站下载最新的PHP_Imagick DLL文件: http://pecl.php.net/package/imagick
    我选择了稳定版(非Beta版或RC版) ,在我的情况3.1.2中,单击Windows徽标+DLL标签。就我而言,它与ht tp://pecl.php.net/package/imagick/3.1.2/windows相关联。
    在页面上它会打开你会找到一个表:你必须选择你的文件取决于:
    a)你拥有的PHP版本的数量(在我的情况下,有PHP 5.3的可用DLL, 5.4,​​5.5,5.6)
    b)x64或x86版本的PHP你有
    c)你有
    的NTS或TS版本的PHP我的情况是PHP 5.5.x,x64,NTS:so我下载了一个标有5.5 Non Thread Safe(NTS)x64的文件(文件名:php_imagick-3.1.2-5.5-nts-vc11-x64.zip)

    3) download latest PHP_Imagick DLL file from PECL website at: http://pecl.php.net/package/imagick I choosed a stable (not Beta or RC) version, in my case 3.1.2, clicking on the "Windows logo"+"DLL" label. In my case it was linked to ht tp://pecl.php.net/package/imagick/3.1.2/windows . On the page it will open you'll find a table: you have to choose your file depending on: a) number of version of PHP you have (in my case there were available DLLs for PHP 5.3, 5.4, 5.5, 5.6) b) x64 or x86 version of PHP you have c) NTS or TS version of PHP you have My case is was PHP 5.5.x, x64, NTS: so I downloaded the one labeled "5.5 Non Thread Safe (NTS) x64" (file name: php_imagick-3.1.2-5.5-nts-vc11-x64.zip)

    4)解压缩php_imagick ZIP并:
    a)将php_imagick.dll文件复制到PHP安装的EXT文件夹中
    b)复制并替换刚刚解压缩到的文件夹中的所有CORE_RL_ .dll你在第2点选择的文件夹。显然,请备份替换的文件。在我的例子中,我将8个CORE_RL _ .dll文件从解压缩文件夹复制到C:\ ImageMagick6.9.0。我留下了C:\ ImageMagick6.9.0其他CORE_RL _ *。dll没有被覆盖。

    4) Unzip the php_imagick ZIP and: a) copy php_imagick.dll file into the EXT folder of your PHP installation b) copy and replace ALL the CORE_RL_.dll from the folder you just unzipped into the folder you choosed at point #2. Obviously, please backup replaced files. In my case I copied 8 CORE_RL_.dll files from unzipped folder to C:\ImageMagick6.9.0. I leaved into C:\ImageMagick6.9.0 the others CORE_RL_*.dll not overwritten.

    5)编辑并保存你的PHP.ini文件以便添加这个简单的行:
    extension = php_imagick.dll

    5) Edit and save your PHP.ini file in order to add this simple row: extension=php_imagick.dll

    6)重新启动你的服务器(不幸的是我没有找到任何重启的替代品:来自管理员的IISRESET命令提示符不起作用。)

    6) Reboot your server (unfortunally I didn't find any good alternative of a reboot: also a IISRESET from admin command-prompt didn't work).

    7)重新启动完成后,通过浏览器远程访问您的phpinfo.php文件,以验证Imagick模块是否正常。在我的情况下它是。

    7) When reboot finished, visit remotely by browser your phpinfo.php file in order to verify that Imagick module was ok. In my case it was.

    希望这可以帮助,在那里!

    Hope this could help, out there!

    这篇关于使用php / windows安装ImageMagick扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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