| 11:08 pm on Sep 10, 2002 (gmt 0)|
have you checked that the directory you are writing too has the correct rights?
| 12:13 am on Sep 11, 2002 (gmt 0)|
You can use fopen - [php.net...] - to create a file. You'll need to check the correct permissions on the script and directory are set though, or you'll end up with 'Permission Denied' errors.
| 1:55 am on Sep 11, 2002 (gmt 0)|
What permissions do I need? Is 755 enough or do I need a 666? (if the directory is on my site)
| 9:37 pm on Sep 11, 2002 (gmt 0)|
(if the directory is on my site)
I think the deal is that you need correct permissions for the PHP process, not for you, and the PHP process is not the owner of the directory. So you probably need at least group write permission (665 or 765) but probably 666 or 766. Try 665 first, then 666. If you have to grant public write to write the file, what I have done is surround the file write line with chmods and change the perms, write the file, then take away public write. Not the best, but it's better than nothing.
| 12:06 pm on Sep 12, 2002 (gmt 0)|
Well, I tried that yesterday (surrounding the fwrite with chmods) and it didn't work. The PHP script wasn't allowed to chmod the file or the directory. I'll have to talk with my provider about this.
| 2:39 pm on Sep 12, 2002 (gmt 0)|
Here's the deal. The "user" trying to write the files is your webserver. If the webserver is run as "nobody" then "nobody" would need to have rights to write files whereever your script calls for them.