note 63319 rejected from faq.misc by bjori
| From: | bjori@php.net | Date: | Mon, 20 Mar 2006 07:20:08 +0000 |
| Subject: | note 63319 rejected from faq.misc by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106088@lists.php.net to get a copy of this message | ||
Note Submitter: longng2000 at yahoo dot com
----
I just started learning php and wrote some simple php codes using fopen() function with different
modes. With 'r' mode, it is okay, but when I wrote it with 'a' mode, it showed
error of failing to create stream. The code is:
<?php
$file = "data.txt";
$handle = fopen($file, 'a');
fputs ($handle, 'New world!');
fclose ($handle);
?>
and error message is:
Warning: fopen(data.txt) [function.fopen]: failed to create stream: Permission denied in
/home/cs554_12/public_html/lab4/tmp/append.php on line 3
Warning: fputs(): supplied argument is not a valid stream resource in
/home/cs554_12/public_html/lab4/tmp/append.php on line 5
Warning: fclose(): supplied argument is not a valid stream resource in
/home/cs554_12/public_html/lab4/tmp/append.php on line 6
And with 'w' mode, I got the same problem as above.
Any help would be much appreciated!
Thank you