0
imagecreatefromjpeg()函数说文件不存在,但是当我检查使用file_exists()函数,它说存在。imagecreatefromjpeg()函数没有歌厅文件
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
- /上传
- test.jpg放在
- 的index.php
- /上传
什么是你的目录结构?是'html /'你的web根目录? – BenM 2013-03-16 12:37:33
@BenM,是的HTML /是我的webroot。 – user1995997 2013-03-16 12:38:09
检查文件权限 – 2013-03-16 12:38:36