This is a discussion on touch and fopen command within the PHP Language forums, part of the PHP Programming Forums category; Hi, I am kind of new to PHP and while learning I came across the touch command which creates a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I am kind of new to PHP and while learning I came across the touch command which creates a new file. I also came up with fopen to open a file. In both cases I am having the same problem: Source Code: <? $fp=fopen("secondfile.txt", 'w'); fclose($fp); ?> Result: Warning: fopen(secondfile.txt) [function.fopen]: failed to open stream: Permission denied in c:\Inetpub\wwwroot\test.php on line 2 Warning: fclose(): supplied argument is not a valid stream resource in c:\Inetpub\wwwroot\test.php on line 3 I am running windows xp professional sp2 with localhost. I don't have any problems reading a file. Its writing where I am having problems. Any help is appreciated. Thanks |
|
|||
|
nihad.nasim@gmail.com kirjoitti:
> Hi, > I am kind of new to PHP and while learning I came across the touch > command which creates a new file. I also came up with fopen to open a > file. In both cases I am having the same problem: .... > stream: Permission denied in c:\Inetpub\wwwroot\test.php on line 2 You've not granted write permission for the webserver user to the directory where you are trying to create a file. It's usually helpful to read the error messages. -- Rami.Elomaa@gmail.com "Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze |
|
|||
|
> You've not granted write permission for the webserver user to the > directory where you are trying to create a file. It's usually helpful to > read the error messages. > > -- Yes I know that but how do I fix that problem in localhost? In other words, how do I grant write permission for the webserver user to the directory where I am trying to create the file? |
|
|||
|
nihad.nasim@gmail.com wrote:
>> You've not granted write permission for the webserver user to the >> directory where you are trying to create a file. It's usually helpful to >> read the error messages. >> >> -- > > Yes I know that but how do I fix that problem in localhost? In other > words, how do I grant write permission for the webserver user to the > directory where I am trying to create the file? > This is an OS administration task. You might check the documentation for Windows XP and/or microsoft.com. Learn about the security features for XP. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |