imagecreatefromjpeg() 函数说文件不存在,但是当我使用 file_exists() 函数检查时,它说存在。
PHP代码就像,
$path = "/home/content/html/uploads/test.jpg";
if(file_exists($path)) {
echo "Exists!";
} else {
echo "File Not Exists!";
}
$resize = new Resize($path, $img['name']);
$resize->resizeImage($size[0], $size[1]);
$resize->preview();
我得到了这样的输出,
Exists!
Warning: imagecreatefromjpeg(/home/content/html/uploads/test.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/content/html/includes/resize.php on line 20
目录结构,
- /html
- /上传
- 测试.jpg
- 索引.php
- /上传