Re: File Write Permission Errors - HELP! URGENT!!!
| From: | Phil Powell | Date: | Mon, 25 Nov 2002 13:09:56 +0000 |
| Subject: | Re: File Write Permission Errors - HELP! URGENT!!! | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125926@lists.php.net to get a copy of this message | ||
I did just that. Permissions are set the /chat folder as it is in all other
folders. This is the first time I've ever done fopen with "w" and I can't
get it to write, always getting "unable to access" errors. I want to be able
to create the file if it does not exist. It works for me to do "r" in all
other folders with the same permissions as /chat.
Phil
"Craig" <craig@phirus.com> wrote in message
news:20021125130406.48304.qmail@pb1.pair.com...
> you must give the same permissions to the folder also.
>
>
> "Phil Powell" <soazine@erols.com> wrote in message
> news:0ca201c2947e$44690a80$dcbe6444@scandinawa1bo6...
> Hi I have the following code that breaks:
>
> // PLACE NICK INTO NICKNAMES.TXT AND START OFF MESSAGES.TXT
> $fileID = fopen($path . "/nicknames.txt", "a") or die("Could not
> open "
.
> $path . "/nicknames.txt");
> chmod($path . "/nicknames.txt", 0755);
> fputs($fileID, $nickname . "\n"); fflush($fileID); fclose($fileID);
> $fileID = fopen($path . "/messages.txt", "a") or die("Could not
> open "
.
> $path . "/messages.txt");
> fputs($fileID, "*** WELCOME \"" . $nickname . "\" TO THE ROOM
> ***");
> fflush($fileID); fclose($fileID);
>
>
> I am getting the following error:
> Warning: fopen("/users/ppowell/web/chat/nicknames.txt", "a") - Permission
> denied in /users/ppowell/web/chat/chat.php on line 163
>
> I am attempting to write onto the files if they exist, if not, create them
> on the fly. I need the solution in the next 5 minutes - sorry, kind of an
> emergency!
>
> If anyone can help, please tell me what to do, the PHP manuals are not
> giving me a clear solution as to how to write to a file that does not yet
> exist that has to have the permissions of 0755 for both files.
>
> Thanx
> Phil
>
>
>