How exactly do I check all those permissions? It is my other pc that is running IIS with all this so I have full access to it.
Thanks, Jebus
Main Topics
Browse All TopicsI am writing a small script that I need to write my data to a file on my web server.
<?php
$filename = $_POST['filename'];
$data = $_POST['newdata'];
$fh = fopen($filename, "w");
fwrite($fh, $data);
fclose($fh);
echo "        File has been successfully updated.<br>";
?>
Warning: fopen("about.html", "w") - Permission denied in C:\BlahDir\write.php on line 107
I am running IIS on winxp pro, and I have all the settings set that I could find to enable access for read/write and all that. It only does this problem for opening the file for write, but only if the file exists. If I manually delete the file first then it will create the file for me fine, but this is not an option for my situation. I get the same error if I try to use unlink to delete the file first, so the problem is related somehow with writing to the existing files. I have tried googleing this problem but nothing seems to have an answer that I can understand. (I'm very new to php and only know basics of my IIS). I have read that this is possibly caused by the permissions of which php is running under in windows or something. Please help, I am creating this so that I can update my website this way while I'm on a long vaction which I am leaving for very soon!
Thanks, Jebus
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
in the directory you are adding / deleting / modifying files, make sure that the "Internet Guest Account" has access rights to do all of the above. Do this by right clicking on the folder in question, selecting properties. now click the security tab. IUSR_<computer name> is probably not in there, so click "add user..."
now, click advanced and do a search. pick the internet guest account from that list, click ok. now specify the permissions you want that user to have.
if you do in fact already have IUSR_<computer name> in there with all permissions and am still getting this problem, then we have another problem on our hands
let me know your findings on this one.
-Chris
Business Accounts
Answer for Membership
by: techtonikPosted on 2004-05-21 at 03:04:16ID: 11125130
Could you modify files, created by PHP without deleting them when you execute the script for the second time?
If so - check permissions on newly created files and your manually uploaded ones. Seems, that when you upload them - you set permissions to delete only for owner - i.e. you. PHP under IIS executed (afaik) as IUSR_ account, so you need to enable that account to delete these files. Compare permissions to figure out which ones need to be modified. And supply your PHP/IIS versions together with sample permissions if something will go wrong.