472,111 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,111 software developers and data experts.

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_file_name);
}

if($new_pic){rename($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.
Jul 17 '05 #1
1 2674
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" <ne********@chamomile.co.uk> wrote in message
news:41********@dnews0.news.legend.net.uk...
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_file_name);
}

if($new_pic){rename($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.

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by sean | last post: by
1 post views Thread by Alexandru | last post: by
4 posts views Thread by nitinpatel1117 | last post: by
banning
2 posts views Thread by banning | last post: by
1 post views Thread by fcaserio | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.