imagick:无法打开文件 [英] Imagick: unable to open file

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

问题描述

简单地调用Imagick类时:

When simply calling the Imagick class:

$image = new Imagick('/images/magick/atmsk.png');

我收到错误消息:

致命错误:带有消息的未捕获异常'ImagickException' '无法打开文件`/images/magick/atmsk.png'@ png.c/ReadPNGImage/2889'in .../imag.php:4堆栈跟踪:#0 .../imag.php(4):imagick-> __ construct('/images/magick/...')#1 {main} 扔进.../imag.php

Fatal error: Uncaught exception 'ImagickException' with message 'unable to open file `/images/magick/atmsk.png' @ png.c/ReadPNGImage/2889' in .../imag.php:4 Stack trace: #0 .../imag.php(4): Imagick->__construct('/images/magick/...') #1 {main} thrown in .../imag.php

我已经按照此处的其他帖子检查了可用的内存,没关系!

I have checked memory available as per another posting here and that is ok!

推荐答案

使用图像的完整路径,例如:

Use the full path to the image, for example:

$image = new Imagick($_SERVER['DOCUMENT_ROOT'] . '/images/magick/atmsk.png');

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

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