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
-
- Posts: 15
- Joined: Tue Feb 24, 2004 6:54 pm
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
wrong user/group when files are created with fopen
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
Archived topic from Iceteks, old topic ID:2193, old post ID:18580
Honk if you love Jesus, text if you want to meet Him!
wrong user/group when files are created with fopen
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
Archived topic from Iceteks, old topic ID:2193, old post ID:18641