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