I have photo upload on my site and it is working well when I was testing it on localhost. This is how and where the photo I uploaded on my localhost:
if($_FILES['file']['error'][$key] == 0 &&
move_uploaded_file($_FILES['file']['tmp_name'][$key],
"../gallery/{$gallery_images}"
)
){
....
}
But when I tried this on a webserver, it started showing errors. These are the errors:
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
What should I do? I tried change the path but the same errors show up.