Page 1 of 1

wrong user/group when files are created with fopen

Posted: Mon Mar 29, 2004 7:04 pm
by Master of Puppets_it
When i use fopen() to open files, they have the wrong user/group, and can't modify them to where i have write priveleges. I'm on linux, and recently i've moved to a local server.

$open=fopen("file.php","a");

This will open the file, and let me write to it once.(What I write to it on the starting script) But if I call an fopen() to open it in a different script, I get the error that its not a valid resource. I'm guessing the reason is there is no write permission. How can i change the user/group from 'wwwrun/www' inside the script? or maybe change something else that makes files created by an fopen command 'me/mygroup'. Can someone help?

Archived topic from Iceteks, old topic ID:2193, old post ID:18577

wrong user/group when files are created with fopen

Posted: Mon Mar 29, 2004 7:51 pm
by Red Squirrel
Hmmm weird.... if it's chmodded to 777 any user should be able to access it, and fopen chmods to 777 by default I believe. Maybe check php.ini to make sure this is in fact right, maybe there's a setting in there somewhere. I never seen one but never looked far in that file either. Had a few things to change in it and that's it.

Archived topic from Iceteks, old topic ID:2193, old post ID:18580

wrong user/group when files are created with fopen

Posted: Thu Apr 01, 2004 1:47 am
by Fat Cat
this may be a stupid suggestion from a newbie, but have you closed the file at the end of each write script ? (fclose) . If left open you won't be able to reopen it.

Archived topic from Iceteks, old topic ID:2193, old post ID:18641