imagick的PHP窗口 [英] Imagick php windows

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

问题描述

我正在尝试在Symfony2中使用iMagick.

I am trying to use iMagick in Symfony2.

我正在使用PHP 5.4.16,我已经完成了所有操作:

I am using PHP 5.4.16 and all i have done :

1-从提取的 http:/中的php5-4目录中复制php_imagick_nts.dll./valokuva.org/~mikko/imagick-php54-php53.tgz 转换为php/ext.

1-Copy php_imagick_nts.dll from php5-4 directory from the extracted http://valokuva.org/~mikko/imagick-php54-php53.tgz to php/ext .

2-将其重命名为php_imagick.dll,然后将"extension = php_imagick.dll"添加到php.ini

2-Rename it to php_imagick.dll and add the "extension=php_imagick.dll" to php.ini

3-创建这样的页面:

3-Create a page like this :

<?php 
    $a = new Imagick();
?>

但是我收到了这个:

Fatal error: Class ‘Imagick’ not found in C:\xampp\htdocs\info.php

当我尝试在symfony控制器中使用它时,错误再次发生:

When I tried to use this in a symfony controller, the error occur again:

FatalErrorException: Error: Class 'Imagick' not found

不幸的是,有关imagick扩展的详细信息没有出现在"phpinfo()"的输出中

Unfortunately the details about imagick extension not appear in output of "phpinfo()"

此版本是否与PHP 5.4.16不兼容?!如果是,我必须使用哪个版本?在哪里?感谢您的帮助...

Is this version is incompatible with PHP 5.4.16 ?! If yes,what version i must use? Where? Thank for any help...

推荐答案

我花了很多时间试图使Imagick正常工作,最终我明白了.

I spent many hours trying to make Imagick work, finally I got it.

我的安装说明

  1. 安装32位WAMP(即使您运行64位系统,也必须使用32位版本的WAMP)
  2. 将ImageMagick安装到C:/imagemagick,使用此文件: https://www.dropbox.com/s/i2mhrhd7sp0ilzk/ImageMagick-6.8.0-3-Q16-windows-dll.exe
  3. 将具有Imagick的DLL放入PHP的扩展文件夹中,例如D:\ wamp32 \ bin \ php \ php5.4.16 \ ext,我使用了此文件: https ://www.dropbox.com/s/ayankf850l08rm2/php_imagick.dll
  4. 在php.ini中,将行"SetEnv MAGICK_HOME C:/imagemagick"不加引号
  5. 更好地重启PC
  1. Install WAMP 32bit (even if you running 64bit system you must use 32bit version of WAMP)
  2. Install ImageMagick to C:/imagemagick, use this file: https://www.dropbox.com/s/i2mhrhd7sp0ilzk/ImageMagick-6.8.0-3-Q16-windows-dll.exe
  3. Put DLL with Imagick into extension folder of PHP, e.g. D:\wamp32\bin\php\php5.4.16\ext, I used this file: https://www.dropbox.com/s/ayankf850l08rm2/php_imagick.dll
  4. In php.ini put line "SetEnv MAGICK_HOME C:/imagemagick" without quotes
  5. Better restart PC

我使用Wamp 2.4,PHP 5.4.16,Apache 2.4.4,ImageMagick 6.8.0-3 2012-10-24 Q16,Imagick 3.1.0RC2-所有32位,OS Win8 64位

现在它应该可以工作了,您应该会在phpinfo中看到Imagick扩展名.

Now it should work and you should see Imagick extension loaded in phpinfo.

我尝试了很多版本的ImageMagick,但是较新的版本无法正常工作,6.8.3-3-Q16-windows-dll可以正常工作.

I tried a lot of versions of ImageMagick, but newer versions didn't work, 6.8.0-3-Q16-windows-dll works fine.

Symfony2

在Symfony2中,像这样使用Imagick:

In Symfony2 use Imagick like this:

$im = new \Imagick('image.jpg');

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

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