[RESOLVED] [function.move-uploaded-file]: failed to open stream: Permission denied in ERROR
I would appreciate some help
.
The problem is that when I use my custom CMS for uploading image on my client website using localhost it work's fine BUT when I moved everything on my client server I got this ERROR when uploading an image :
> Warning: move_uploaded_file(uploads/tmp/74245809612173promo_bg.jpg)
> [function.move-uploaded-file]: failed to open stream: Permission denied in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 67
>
> Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move
> '/tmp/phpEMrqCo' to 'uploads/tmp/74245809612173promo_bg.jpg' in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 67
>
> Warning: imagecreatefromjpeg(uploads/tmp/74245809612173promo_bg.jpg)
> [function.imagecreatefromjpeg]: failed to open stream: No such file or
> directory in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 75
>
> Warning: imagesx(): supplied argument is not a valid Image resource in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 76
>
> Warning: imagesy(): supplied argument is not a valid Image resource in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 77
>
> Warning: Division by zero in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 79
>
> Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid
> image dimensions in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 81
>
> Warning: imagecopyresampled(): supplied argument is not a valid Image
> resource in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 82
>
> Warning: imagejpeg(): supplied argument is not a valid Image resource in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 83
>
> Warning: imagecreatefromjpeg(uploads/tmp/74245809612173promo_bg.jpg)
> [function.imagecreatefromjpeg]: failed to open stream: No such file or
> directory in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 75
>
> Warning: imagesx(): supplied argument is not a valid Image resource in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 76
>
> Warning: imagesy(): supplied argument is not a valid Image resource in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 77
>
> Warning: Division by zero in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 79
>
> Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid
> image dimensions in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 81
>
> Warning: imagecopyresampled(): supplied argument is not a valid Image
> resource in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 82
>
> Warning: imagejpeg(): supplied argument is not a valid Image resource in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 83
>
> Warning: unlink(uploads/tmp/74245809612173promo_bg.jpg) [function.unlink]:
> No such file or directory in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 90
>
> Warning: Cannot modify header information - headers already sent by (output
> started at
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php:67) in
> /home/nmangan/johnhowardson-www/john_backend/validate_tabs_edit.php on line
> 43
I would guess that you need to provide write permission for all on the target directory. (In most web host configurations, you PHP scripts are executed by the web server user, not your personal user account on the server.)
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Unable to move '/tmp/phpEMrqCo' to 'uploads/tmp/74245809612173promo_bg.jpg
...it would appear to be the "uploads/tmp" directory (relative to your script's directory).
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks