我正在制作一个带有图像处理的网站,它在Imagick的帮助下将编辑过的图像保存在服务器上。但是我在“$ POST”期间收到了当前错误:
"NetworkError: 500 Internal Server Error - http://"mysite"/img_save"
并且未执行“$ POST”。 看看我的error_log,它看起来像这样:
[28-Apr-2014 10:11:07 Europe/London] PHP Fatal error: Uncaught exception 'ImagickException' with message 'Unable to read the file: /home2/label/public_html' in /home2/label/public_html/controller/img_save.php:63
Stack trace:
#0 /home2/label/public_html/controller/img_save.php(63): Imagick->readimage('/home2/label/pu...')
#1 /home2/label/public_html/index.php(37): require('/home2/label/pu...')
#2 {main}
thrown in /home2/label/public_html/controller/img_save.php on line 63
引用错误的代码是:
$img_top = new Imagick();
$img_top->readImage($_SERVER['DOCUMENT_ROOT'].$_POST['main_view']); //Line 63
$img->compositeImage($img_top, imagick::COMPOSITE_OVER, -25, -75);
$img->writeImage('files/orders/' . $order_id . '.jpg');
echo json_encode(array('id'=>$order_id));
任何人都可以告诉我错误的本质是什么,我该如何解决?