windows file permission

This is a discussion on windows file permission within the PHP General forums, part of the PHP Programming Forums category; Chris Williams wrote: > I am using PHP on Windows NT CGI/FastCGI and am trying to create a text &...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-19-2003
John W. Holmes
 
Posts: n/a
Default Re: [PHP] windows file permission

Chris Williams wrote:

> I am using PHP on Windows NT CGI/FastCGI and am trying to create a text
> file and then write some data to it.
>
> $some_text = "HelloWorld";
> $new_file = fopen("myfile.txt", "w");
> fputs($new_file, $some_text);
> fclose($new_file);
>
> However I am getting Warning: fopen(myfile.txt): failed to open stream:
> Permission denied in...
>
> I don't usually work on Windows but I checked the file permissons on this
> folder and they seem to be 777 or drwxrwxrwx
>
> I'm guessing I have no idea how Windows permissions work.


I'm not sure what user PHP runs as when using CGI, so you'll probably
need to give "Everyone" permission to read/write to the directory this
script is run in.

Right click on the folder, choose the Security tab, and add Everyone as
a user with the appropriate permissions.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
Reply With Quote
  #2 (permalink)  
Old 11-19-2003
Chris Williams
 
Posts: n/a
Default windows file permission

I am using PHP on Windows NT CGI/FastCGI and am trying to create a text
file and then write some data to it.

$some_text = "HelloWorld";
$new_file = fopen("myfile.txt", "w");
fputs($new_file, $some_text);
fclose($new_file);

However I am getting Warning: fopen(myfile.txt): failed to open stream:
Permission denied in...

I don't usually work on Windows but I checked the file permissons on this
folder and they seem to be 777 or drwxrwxrwx

I'm guessing I have no idea how Windows permissions work.

Chris
Reply With Quote
  #3 (permalink)  
Old 11-19-2003
Burhan Khalid
 
Posts: n/a
Default Re: [PHP] windows file permission

Chris Williams wrote:
> I am using PHP on Windows NT CGI/FastCGI and am trying to create a text
> file and then write some data to it.
>
> $some_text = "HelloWorld";
> $new_file = fopen("myfile.txt", "w");
> fputs($new_file, $some_text);
> fclose($new_file);
>
> However I am getting Warning: fopen(myfile.txt): failed to open stream:
> Permission denied in...
>
> I don't usually work on Windows but I checked the file permissons on this
> folder and they seem to be 777 or drwxrwxrwx


In IIS -- you have to set the permissions to "write" for the folder
that you want to your script to be able to write to (from the IIS manager)

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
-----------------------
"Documentation is like sex: when it is good,
it is very, very good; and when it is bad,
it is better than nothing."
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:31 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0