简体   繁体   English

PHP致命错误:未捕获异常'ImagickException',消息'此解码委托不适用于此图像格式

[英]PHP Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format

I'm using an AWS EC2 Bitnami AMI : bitnami-lampstack-5.4.11-1-linux-ubuntu-12.04.1-x86_64-ebs (ami-aadf4cc3) 我正在使用AWS EC2 Bitnami AMI :bitnami-lampstack-5.4.11-1-linux-ubuntu-12.04.1-x86_64-ebs(ami-aadf4cc3)

I have a php file: 我有一个php文件:

<?php 
    $im = new imagick();
    $im->readImageBlob(file_get_contents("http://s3.amazonaws.com/bucket/file.jpg"));
?>

That gives me the following error: 这给了我以下错误:

PHP Fatal error:  Uncaught exception 'ImagickException' with message 'no decode delegate for this image format `' @ error/blob.c/BlobToImage/361' in /opt/bitnami/apache2/htdocs/index.php:3
Stack trace:
#0 /opt/bitnami/apache2/htdocs/index.php(3): Imagick->readimageblob('??????JFIF?????...')
#1 {main}
  thrown in /opt/bitnami/apache2/htdocs/index.php on line 3

I installed imagick using the following steps: 我使用以下步骤安装了imagick:

1) wget http://pecl.php.net/get/imagick-3.1.0RC2.tgz
    2) tar -zxvf imagick-3.1.0RC2.tgz
    3) cd imagick-3.1.0RC2
    4) phpize
    5) ./configure
    6) make
    7) make install

So far, I've tried: 到目前为止,我已经尝试过:

1) file_get_contents is returning the image file and it is a confirmed jpeg
2) using convert directly from the command line --> it works
3) imagick-3.0.1 on this AMI and it won't install because of compiler errors
4) imagick-3.0.1 on the previous bitnami AMI (bitnami-lampstack-5.3.10-2-linux-ubuntu-12.04-x86_64-ebs (ami-8c4c96e5)) and it gives the same ImagickException error (no decode delegate)
5) Using a PNG file which gives me the same error

Convert -list configure gives me DELEGATES bzlib freetype jpeg jng png tiff zlib 转换-list configure给了我DELEGATES bzlib freetype jpeg jng png tiff zlib

Solution: 解:

update /opt/bitnami/scripts/setenv.sh as follows with 更新/opt/bitnami/scripts/setenv.sh ,如下所示

MAGICKCODERMODULE_PATH="/usr/lib/ImageMagick-6.6.9/modules-Q16/coders"

THEN 然后

`/opt/bitnami/ctlscript.sh restart apache`

暂无
暂无

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

相关问题 PHP Imagick - ImagickException(代码:420):此图像格式* .jpg没有解码委托 - PHP Imagick - ImagickException(code: 420): no decode delegate for this image format *.jpg Imagick给我致命错误:未捕获异常&#39;ImagickException&#39;,消息&#39;无法打开图像 - Imagick giving me Fatal error: Uncaught exception 'ImagickException' with message 'unable to open image 错误:未捕获的异常“ImagickException”和消息“无效的图像几何” - ERROR: Uncaught exception 'ImagickException' with message 'Invalid image geometry' PHP未捕获异常&#39;ImagickException&#39;,消息&#39;FailedToExecuteCommand&#39; - PHP Uncaught exception 'ImagickException' with message 'FailedToExecuteCommand' 致命错误:Uncaught ImagickException:PDFDelegateFailed - Fatal error: Uncaught ImagickException: PDFDelegateFailed PHP致命错误:带有消息的未捕获异常“异常” - PHP fatal error: Uncaught exception 'Exception' with message php_imagick错误,消息“无法加载”的未捕获异常“ ImagickException” - php_imagick error, Uncaught exception 'ImagickException' with message 'unable to load module 未捕获的异常'ImagickException',消息'比较图像失败' - uncaught exception 'ImagickException' with message 'Compare images failed' 未捕获的异常&#39;ImagickException&#39;,消息&#39;无法读取文件&#39; - Uncaught exception 'ImagickException' with message 'Failed to read the file' 未捕获的异常'ImagickException',消息'无法读取文件' - Uncaught exception 'ImagickException' with message 'Unable to read the file'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM