View Full Version : Problem writing a file on XP with AD

11-04-2003, 08:17 PM
Ok, I've got the following line in my code...

$fh = fopen($file,"w+");

Which gives me the following error...

Warning: fopen(./mqotd.rss) [function.fopen]: failed to create stream: Permission denied in D:\WebPub\includes\rssFeed.php on line 58

I'm guessing it's a permssions problem where the server isn't allowed to write to the directory. How do I set the permissions to write the file as me and not the web server?

11-04-2003, 10:11 PM
chomd it to 777

11-04-2003, 10:26 PM
I would, however, in order to chmod, I need to create the file first. (Or at least I thought I did)
Yep, still get the same error.

11-04-2003, 10:51 PM
Have you tried chmod'ing the directory the file's to be created in to 777?

11-05-2003, 04:23 PM
Well, I figured it out.

I was trying to access (write and create) a file on a network drive which is mapped on my box but not on the server.

So I changed the code to use the absolute path instead using UNC naming conventions...


and it worked.

NOTE: backslashes do NOT work.

11-05-2003, 04:25 PM
heh, glad you got it fixed, I also just noticed that you're on xp and not unix, so chmod'ing went straight out the window there lol