Page 1 of 1

fopen working for r mode but not for a and w mode

Posted: Thu May 03, 2007 10:07 am
by rakeshgouru
I Just Installed the php 5.0.4 and mysql, i tested the phpinfo(); and its working fine. But when i used the function fopen in read mode its working fine but my php is not working for append mode and write mode, i couldnot understand the problem. The error message is as following :

Warning: fopen(test.txt) [function.fopen]: failed to open stream: Permission denied in c:\Inetpub\wwwroot\test\test.php on line 2


Can anyone help me Thanks in advance.

Posted: Thu May 03, 2007 11:19 am
by guitarlvr
The user which is trying to open the file has read permission and not write. It looks like your using MS IIS as your webserver. See what kind of permissions IUSR_{servername} has and if it has read make sure if has read/write/modify at least.

Wayne

Thanks Wayne

Posted: Fri May 04, 2007 8:28 am
by rakeshgouru
Yes my webserver is MS IIS, how could i set permissions IUSR_{ servername } as read/write/modify.

[s]Plz[/s] please Guide me Wayne.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.

Posted: Fri May 04, 2007 9:21 am
by guitarlvr
You'll right click on your wwwroot directory, select properties and then security from the tabs at the top. One of the users in the list should be internet guest account. highlight that user and make sure he has "read and execute", "modify", "read", and "write". I usually give him full control but you dont have to. You will probably want to click on the advanced button in that window and check the box that says replace permission entries on all child objects. Try that out and let me know what happens.

Wayne

Thank You

Posted: Mon May 07, 2007 2:14 am
by rakeshgouru
Thank You very much Wayne, My problem solved. I done as per your instructions and now its working fine for both append mode and write mode.

Posted: Mon May 07, 2007 2:56 am
by nickvd
MMMM Full control on an IIS server...