图像目录正在localhost上工作,但不在webserver

时间:2016-04-16 17:00:59

标签: php image file-upload webserver image-uploading

我在我的网站上有照片上传,当我在localhost上测试时,它运行良好。这是我在localhost上传的照片的方式和位置:

if($_FILES['file']['error'][$key] == 0 && 
   move_uploaded_file($_FILES['file']['tmp_name'][$key], 
                      "../gallery/{$gallery_images}"
                     )
   ){
....
}

但是当我在网络服务器上尝试这个时,它开始显示错误。这些是错误:

Warning: move_uploaded_file(../gallery/289228065.jpg): failed to open stream: Permission denied in /var/www/alumni/admin/create_album.php on line 51 

Warning: move_uploaded_file(): Unable to move '/tmp/php3hJjHL' to '../gallery/289228065.jpg' in /var/www/alumni/admin/create_album.php on line 51

Warning: move_uploaded_file(../gallery/2001593678.jpg): failed to open stream: Permission denied in /var/www/alumni/admin/create_album.php on line 51 

Warning: move_uploaded_file(): Unable to move '/tmp/phpDiNyPg' to '../gallery/2001593678.jpg' in /var/www/alumni/admin/create_album.php on line 51

我该怎么办?我尝试更改路径,但显示相同的错误。

0 个答案:

没有答案