[英]PHP Imagick - ImagickException(code: 420): no decode delegate for this image format *.jpg
Yesterday I includes ondrejs PPA and installed PHP5, 5.6 and 7. Everything is working fine except the imagick functions. 昨天我包括ondrejs PPA并安装了PHP5,5.6和7.除了imagick功能外,一切正常。 The exact exception is:
确切的例外是:
request.CRITICAL: Uncaught PHP Exception ImagickException: "no decode delegate
for this image format `lorem.jpg' @ error/constitute.c/ReadImage/544" at
ImageManager.php line 72
So I checked all installations and some stackoverflow questions but nothing seems to work. 所以我检查了所有安装和一些stackoverflow问题,但似乎没有任何工作。 Some more information.
更多信息。
convert -list configure output convert -list配置输出
DELEGATES bzlib djvu fftw fontconfig freetype jbig jpeg jng jp2 lcms2 lqr lzma openexr pango png rsvg tiff x11 xml wmf zlib
but phpinfo() 但是phpinfo()
ImageMagick supported formats no value
Any ideas? 有任何想法吗?
The solution in my case was, that ImageMagick and GraphicsMagick where both as PHP extension enabled. 在我的案例中的解决方案是ImageMagick和GraphicsMagick,其中两者都启用了PHP扩展。 I don't know why, but it seems something during the installation of the custom PPA went wrong or not at least not as expected.
我不知道为什么,但似乎在安装自定义PPA期间出现了问题,或者至少没有达到预期的效果。
Disabling the GraphicsMagick extension solved the problem and all supported formats where displayed within the php.ini correctly and all ImageMagick functions worked as expected. 禁用GraphicsMagick扩展解决了问题,并且所有支持的格式都正确地显示在php.ini中,并且所有ImageMagick函数都按预期工作。
Following this post, I've found a solution . 在这篇文章之后,我找到了一个解决方案 。 My need was for Perl module, not PHP (same error message).
我需要的是Perl模块,而不是PHP(相同的错误信息)。
Download what you need from here , configure and install, by default to /usr/local
. 从这里下载所需内容,配置并安装,默认为
/usr/local
。
Then you can recompile your imageMagick, with correct option, and the compilation process will now find dependencies. 然后,您可以使用正确的选项重新编译imageMagick,编译过程现在将找到依赖项。 (adding the path to the lib on you system is obviously not enough).
(在你的系统上添加lib的路径显然是不够的)。
Pay attention to the installation path, in /usr/local
by default (so you need to move probably your PHP compiled libs somewhere else, or change your path). 请注意默认情况下在
/usr/local
的安装路径(因此您需要将PHP编译的库移动到其他位置,或者更改路径)。
By the way, you will surely need to call the linker, surely what was wrong in your case: 顺便说一下,你肯定需要调用链接器,肯定是你的情况出了什么问题:
sudo ldconfig /usr/local/lib
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.