简体   繁体   English

无法使用 Imagick 类

[英]Unable to use Imagick class

I have installed imagick version:6.8.6-7 on my PC Operating system:Windows 7 32-bit我已经在我的 PC 上安装了 imagick 版本:6.8.6-7 操作系统:Windows 7 32-bit

Now i want to use Imagick for my PHP project.I am using Wampserver which provides me PHP version:5.3.10 .So i also installed a .dll file,made changes in php.ini,verified if the path is set with php_info() before using Imagick class and everything was ok.现在我想在我的 PHP 项目中使用 Imagick。我正在使用 Wampserver,它为我提供了PHP 版本:5.3.10 。所以我还安装了一个.dll文件,在 php.ini 中进行了更改,验证路径是否设置为 php_info( ) 在使用 Imagick 类之前,一切正常。

Problem description: I wrote the script to test if i can use Imagick.Following is the script:问题描述:我写了脚本来测试我是否可以使用Imagick。以下是脚本:

<?PHP
function alist ($array) {  //This function prints a text array as an html list.
$alist = "<ul>";
for ($i = 0; $i < sizeof($array); $i++) {
  $alist .= "<li>$array[$i]";
}
$alist .= "</ul>";
return $alist;
}
exec("convert -version", $out, $rcode); //Try to get ImageMagick "convert" program version number.
echo "Version return code is $rcode <br>"; //Print the return code: 0 if OK, nonzero if error.
echo alist($out); //Print the output of "convert -version"

if(class_exists("imagick") )
{
echo "Ready to use Imagick class";
}
else
{
echo "Cannot use Imagick class";
}
?>

Output输出

Version return code is 0

    Version: ImageMagick 6.8.6-7 2013-07-23 Q16 http://www.imagemagick.org
    Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
    Features: DPC OpenMP
    Delegates: bzlib djvu fftw fontconfig freetype jng jp2 jpeg lcms lzma openexr pango png ps tiff x xml zlib

Cannot use Imagick class

So even if the Version is properly displayed,i am not able to use Imagick class.How to fix this,help所以即使版本正确显示,我也无法使用 Imagick 类。如何解决这个问题,帮助

1: Install ImageMagick software Link 1:安装ImageMagick软件链接

2: Download pecl-5.2-dev.zip (choose the version relevant to your PHP) from http://snaps.php.net/ 2:从http://snaps.php.net/下载pecl-5.2-dev.zip(选择与你的PHP相关的版本)

3: Copy php_imagick.dll from the archive you've downloaded to your PHP extention folder. 3:将 php_imagick.dll 从您下载的存档复制到您的 PHP 扩展文件夹。

4: Add the following line to php.ini (in the exntentions section): extension=php_imagick.dll 4:在php.ini(在exntentions部分)添加以下行:extension=php_imagick.dll

5: Restart your server 5:重启你的服务器

cmorrissey's link for 2) seems to be broken but dlls can be downloaded here . cmorrissey 的 2) 链接似乎已损坏,但可以在此处下载 dll。

If you get a "CORE_RL_wand_.dll is missing" error, the solution is here .如果您收到“CORE_RL_wand_.dll is missing”错误,解决方法在这里 In my case, I had to take all the "CORE" dlls from the ImageMagic installation folder and copy them into the /php folder.就我而言,我必须从 ImageMagic 安装文件夹中取出所有“CORE”dll 并将它们复制到 /php 文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM