Imagick: unable to open file

自闭症网瘾萝莉.ら 提交于 2019-12-07 04:47:06

问题


When simply calling the Imagick class:

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

I get the error message:

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!


回答1:


Use the full path to the image, for example:

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


来源:https://stackoverflow.com/questions/15446687/imagick-unable-to-open-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!