PHP的致命错误:未捕获的异常“ImagickException”有消息“无德code代表该图像格式 [英] PHP Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format
本文介绍了PHP的致命错误:未捕获的异常“ImagickException”有消息“无德code代表该图像格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是AWS EC2汇出AMI :汇出-lampstack-5.4.11-1-Linux的Ubuntu的12.04.1-x86_64的-EBS(AMI-aadf4cc3)
I'm using an AWS EC2 Bitnami AMI: bitnami-lampstack-5.4.11-1-linux-ubuntu-12.04.1-x86_64-ebs (ami-aadf4cc3)
我有一个PHP文件:
<?php
$im = new imagick();
$im->readImageBlob(file_get_contents("http://s3.amazonaws.com/bucket/file.jpg"));
?>
这给了我以下错误:
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
我使用以下步骤安装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
到目前为止,我已经试过:
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
转换-list配置给了我DELEGATES bzlib FreeType的JPEG JNG PNG TIFF的zlib
推荐答案
解决方法:
更新 /opt/bitnami/scripts/setenv.sh
与如下:
难懂codeRMODULE_PATH =/ usr / lib目录/ ImageMagick的-6.6.9 /模块-Q16 / codeRS
然后
`/opt/bitnami/ctlscript.sh restart apache`
这篇关于PHP的致命错误:未捕获的异常“ImagickException”有消息“无德code代表该图像格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文