www.webdeveloper.com
Results 1 to 6 of 6

Thread: [RESOLVED] [function.move-uploaded-file]: failed to open stream: Permission denied in ERROR

  1. #1
    Join Date
    Feb 2010
    Posts
    4

    resolved [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

    My worry is only about the first three lines

    Thanks in advance for your help.

    Yanick

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,361
    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

    eBookworm.us

  3. #3
    Join Date
    Feb 2010
    Posts
    4
    Ok what are the target directories?

  4. #4
    Join Date
    Feb 2010
    Posts
    4
    I use 777 for validate_tabs_edit.php

  5. #5
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,361
    From this message:
    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

    eBookworm.us

  6. #6
    Join Date
    Feb 2010
    Posts
    4
    GOOD job it work's

    I appreciate your help.
    Thanks.

    Yanick

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles