Page 1 of 1

WinXP pro, unlink(): PERMISSION DENIED

Posted: Sun Aug 01, 2004 10:05 pm
by Fanstop.tk
I am running a script off my personal Apache server with PHP5 on my windows XP professional computer, and I have a script intent on being able to alter and delete files from the "localhost" directory. I've Google, forum and PHP.net searched the web only to find nothing. So, here I turn.

I am a computer admin, supposedly full access... but every time I run this snippet script:

Code: Select all

<?php
$file = "index2.php";
if($action == "del"){
	unlink($file);
}

?>
I recieve this error:
Warning: unlink() [function.unlink]: Permission denied in c:\program files\apache group\Apache\htdocs\dirinfo.php on line 60
I've used the chmod function, setting permissions to 0777... only to find the fileperms() function returns the number "33206" on the files. Any Ideas on how to give permissions to my script and files?

Posted: Thu Aug 05, 2004 6:47 pm
by Fanstop.tk
*bump* Does anyone know how to fix this?

Posted: Thu Aug 05, 2004 7:38 pm
by Joe
The CHMOD function should do the trick? Something along the lines of:

chmod("/mydir/file.php", 0777);

If that does not help you at all then I recommend setting the permissions via an ftp client such as cuteftp. Works for anyone and very efficiently.


Joe 8)

Posted: Tue Aug 24, 2004 10:24 am
by liljester
check the permissions on the directories, make sure they arent read only or somesuch.