[thelist] PHP plumbing: "fwrite(): supplied argument is not a valid stream"

Sam Hunting sam_hunting2004 at yahoo.com
Fri Oct 27 11:31:52 CDT 2006


I'm sure this is a newbie question that's in the FAQ,
but I can't find the FAQ:

Here's the error:

ing: fwrite(): supplied argument is not a valid stream
resource in /Library/WebServer/Documents/blah/foo.php
on line 62

And here is the code:
             $filename = "../../tmp/" .  $filename .
".xml";
             $fileout = fopen($filename,"w");
             fwrite($fileout,"...\n");
Yes, "../../tmp/" is a valid path on the file system.

This feels like a permissions issue, but how do I
diagnose that, and what combination of chmod, chown,
chgrp do I use to get PHP to write the file to a
directory that I know exists?

NOTE: tmp is outside the apache document tree, which I
understand is good practice.

Thanks for any help you can give. (Of course, I
Googled the string, but the error is itself all over
the Internet on actual pages, so the FAQ may be lost
in the haystack.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the thelist mailing list