WinXP pro, unlink(): PERMISSION DENIED

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Fanstop.tk
Forum Newbie
Posts: 17
Joined: Wed Jul 21, 2004 11:02 pm

WinXP pro, unlink(): PERMISSION DENIED

Post 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?
Fanstop.tk
Forum Newbie
Posts: 17
Joined: Wed Jul 21, 2004 11:02 pm

Post by Fanstop.tk »

*bump* Does anyone know how to fix this?
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post 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)
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post by liljester »

check the permissions on the directories, make sure they arent read only or somesuch.
Post Reply