www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] failed to open stream: Permission denied

  1. #1
    Join Date
    Apr 2009
    Posts
    73

    resolved [RESOLVED] failed to open stream: Permission denied

    Hello Experts,

    Following is my code, and it gives me the error "failed to open stream: Permission denied". I am using PHP 5.2 with IIS installed on windows XP system.

    PHP Code:
    <html>
    <head>
    <title></title>
    <body>
    <?PHP
    $file
    =file_get_contents("test/count.txt");
    echo 
    "Visitor #:  $file";
    $visitors $file;
    $visn $visitors 1;
    $handle fopen("test/count.txt","w");
    fwrite($handle$visn);
    fclose($handle);
    ?>
    </body>
    </html>

    and the complete error it shows is:

    Code:
    Visitor #: 0PHP Warning: fopen(test/count.txt) [function.fopen]: failed to open stream: Permission denied in D:\MyWeb\testPHP_Files.php on line 10 PHP Warning: fwrite(): supplied argument is not a valid stream resource in D:\MyWeb\testPHP_Files.php on line 11 PHP Warning: fclose(): supplied argument is not a valid stream resource in D:\MyWeb\testPHP_Files.php on line 12
    Please help.

  2. #2
    Join Date
    Apr 2009
    Posts
    73
    Oh dears,

    I have to grand "write" permissions to IUSR_SERVER account. and it worked.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles