Page 1 of 1

Need help with permissions

Posted: Wed Jul 16, 2003 8:42 pm
by DuFF
Hey guys, I'm helping NiceJob make a script and although it works fine on my server (Tripod/Lycos) it doesn't seem to like his server. Heres the code I'm using:

Code: Select all

<?php
else {
     touch($usersfile);
     chmod($usersfile,0666);
     $new_file=fopen($usersfile, "w");
     fwrite($new_file, "01|$username|");
     fclose($new_file);
     echo "Your username was successfully added.";
     }
?>
Works perfect for me but here are his errors:
Warning: touch() [function.touch]: Unable to create file usernames.dat because Permission denied in /home/jereese/public_html/RUC/nameadd.php on line 38

Warning: chmod() [function.chmod]: No such file or directory in /home/jereese/public_html/RUC/nameadd.php on line 39

Warning: fopen(usernames.dat) [function.fopen]: failed to create stream: Permission denied in /home/jereese/public_html/RUC/nameadd.php on line 40

Warning: fwrite(): supplied argument is not a valid stream resource in /home/jereese/public_html/RUC/nameadd.php on line 41

Warning: fclose(): supplied argument is not a valid stream resource in /home/jereese/public_html/RUC/nameadd.php on line 42

Obviously, all of the errors after touch have to do with the file not being created. Any help would be greatly appreciated.

Posted: Wed Jul 16, 2003 8:50 pm
by Gen-ik
It could be that you need to make sure the RUC CHMOD value is set to 0777.

Posted: Wed Jul 16, 2003 9:00 pm
by DuFF
I've never used CHMOD before about an hour today. What's RUC mean?

[EDIT]
Well I'm stupid, u meant the RUC directory, sorry I wasn't payin attention to that cuz he put it in there, not me. He CHMOD'ed it and now it works. Thanks a lot.
[/EDIT]