permissions problem with unlink()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chamomile

    #1

    permissions problem with unlink()

    I am having trouble getting unlink() to work on my local machine
    (win 2000, Apache, php 4.2.2)

    when I invoke unlink() in order to change a file name during
    a 'picture edit' change from a form upload on my local machine using simple
    stuff like:

    <?php

    if(file_exists( $new_file_name) ){

    unlink($new_fil e_name);
    }

    if($new_pic){re name($old_file_ name,$new_file_ name);}

    }

    ?>

    I get:

    Warning: unlink() failed (Permission denied) in
    C:\FoxServ\www\ content\do_page _content.php on line 161

    this doesn't happen with my online set-up so I am pretty sure it's a
    permissions issue (and the error message says so!)

    I have looked at and checked the permissions on all the relevant folders via
    win 2000 settings, allowing full read/write to 'everyone' etc.
    but it makes no difference. Maybe I'm not setting them correctly? help
    appreciated.


  • Chamomile

    #2
    Re: permissions problem with unlink()

    oops, sorted this out - I had a problem with naming the file
    earlier in the script which when sorted didn't create this problem.
    classic example of taking an error message too literally and looking in the
    wrong place.



    "Chamomile" <newsgroups@cha momile.co.uk> wrote in message
    news:419c61e7$1 @dnews0.news.le gend.net.uk...[color=blue]
    > I am having trouble getting unlink() to work on my local machine
    > (win 2000, Apache, php 4.2.2)
    >
    > when I invoke unlink() in order to change a file name during
    > a 'picture edit' change from a form upload on my local machine using[/color]
    simple[color=blue]
    > stuff like:
    >
    > <?php
    >
    > if(file_exists( $new_file_name) ){
    >
    > unlink($new_fil e_name);
    > }
    >
    > if($new_pic){re name($old_file_ name,$new_file_ name);}
    >
    > }
    >
    > ?>
    >
    > I get:
    >
    > Warning: unlink() failed (Permission denied) in
    > C:\FoxServ\www\ content\do_page _content.php on line 161
    >
    > this doesn't happen with my online set-up so I am pretty sure it's a
    > permissions issue (and the error message says so!)
    >
    > I have looked at and checked the permissions on all the relevant folders[/color]
    via[color=blue]
    > win 2000 settings, allowing full read/write to 'everyone' etc.
    > but it makes no difference. Maybe I'm not setting them correctly? help
    > appreciated.
    >
    >[/color]


    Comment

    Working...