Re: fwrite error (noobie I am)
| From: | Stephen March | Date: | Sun, 06 Jul 2003 17:06:31 +0000 |
| Subject: | Re: fwrite error (noobie I am) | ||
| References: | 1 2 3 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-20704@lists.php.net to get a copy of this message | ||
Allright, I got ya :)
Open up any folder, let's say My Documents. Then go to the tools menu => Folder Options.
From the "view" tab, scroll all the way down, and you should see something like this:
http://www.enerds.ca/files/screenshots/simple_filesharing.jpg
You must "uncheck" the simple file-sharing.
Now when you right click on the count.txt file, go to properties, you should see a "Security tab"
Hope this helps!
~Steve.
Ron Stephenson wrote:
That's the part I think I'm missing because when I right click on the file and go to the properties there is no "Security" tab, button or anything. It does have two check boxes one for read only (unchecked) and one for Hidden. This is the Windows Explorer version. In the IIS properties there is a "File Security" tab, but it doesn't seem to help. See the attached file. (wouldn't let me send the file Too big I guess) Thanks "Stephen March" <steve@enerds.ca> wrote in message news:3F07CD70.8040004@enerds.ca...If you right click on the file count.txt, go to properties -> security.$counter_file.");Does "everyone" have modify/write permissions to this file? Thefirst error it posts, is that it doesn'thave permissions to alter the file. This would also account for itfailing to create the stream. ~Steve Ron Stephenson wrote:I'm trying to learn PHP and I have it loaded on my PC with XP pro and IIS 5.1. I run the following script and receive the error below. //hit_counter1.php $counter_file = "./count.txt"; if(!($fp = fopen($counter_file, "r"))) die ("Cannot openone$counter = (int) fread($fp, 20); fclose($fp); $counter++; echo "You're visitor No. $counter."; $fp = fopen($counter_file, "w"); fwrite($fp, $counter); fclose($fp); When run I get this error: You're visitor No. 126. Warning: fopen(./count.txt) [function.fopen]: failed to create stream: Permission denied in c:\inetpub\wwwroot\hit_counter1.php on line 12 Warning: fwrite(): supplied argument is not a valid stream resource in c:\inetpub\wwwroot\hit_counter1.php on line 13 Warning: fclose(): supplied argument is not a valid stream resource in c:\inetpub\wwwroot\hit_counter1.php on line 14 I though I had set all necessary permissions but I seem to have missed something. Can someone help? I have been to numerous newsgroups and nohas been able to figure it out. I know it is something I'm doing wrong. Ron