Find the answer to your Linux question:
Results 1 to 4 of 4
Alright, in a user's public_html I try to run a script that simply copies an image file from one directory in public_html to another, but I get a "Permission Denied" ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2003
    Posts
    24

    Using user public_html thing


    Alright, in a user's public_html I try to run a script that simply copies an image file from one directory in public_html to another, but I get a "Permission Denied" when I try to do that... I have no idea why. Here is the error.

    Warning: copy(t_2.jpg) [function.copy]: failed to create stream: Permission denied in /home/carshow/webspace/copy.php on line 3

  2. #2
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Verify that you have permissions on the file on the filesystem and to the directorys you want to copy the file to, if not change the permissions with the cmod-command.

    Regards
    Regards

    Andutt

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    The scripts run as the "apache" user, so the target directory needs to have write access for the apache user.
    If this is a CGI program, you can configure Apache's suEXEC mechanism to make them run as the owning user.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    May 2003
    Posts
    24
    Thanks. I changed the permissions and I'm all set now. Now I'm out to get imagemagick to work on my site

Posting Permissions

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