THPWebTeam
asked on
PHP on IIS FOPEN permission denied
I'm trying to either write or create a file, but I keep getting a permission denied error.
failed to open stream: Permission denied [file]
I did the following already:
In the php.ini file :
allow_url_fopen = on
allow_url_include = on
file_uploads = on
On the server:
IIS_IUSR has FULL CONTROL permission which allows:
traverse folder/execute file
list folder/read data
read attribute
read extended attributes
create files/write data
create folders/append data
write attributes
write extended attributes
delete subfolder and files
delete
read permissions
change permissions
take ownership
In my code I've tried:
$file = fopen( $GLOBAL_FILEPATH, 'wb' );
$file = fopen( $GLOBAL_FILEPATH, 'w' );
$file = fopen( $GLOBAL_FILEPATH, 'w+' );
I can read from the file, so that ensures that my directory path is correct.
No luck. Any help would be greatly appreciated.
failed to open stream: Permission denied [file]
I did the following already:
In the php.ini file :
allow_url_fopen = on
allow_url_include = on
file_uploads = on
On the server:
IIS_IUSR has FULL CONTROL permission which allows:
traverse folder/execute file
list folder/read data
read attribute
read extended attributes
create files/write data
create folders/append data
write attributes
write extended attributes
delete subfolder and files
delete
read permissions
change permissions
take ownership
In my code I've tried:
$file = fopen( $GLOBAL_FILEPATH, 'wb' );
$file = fopen( $GLOBAL_FILEPATH, 'w' );
$file = fopen( $GLOBAL_FILEPATH, 'w+' );
I can read from the file, so that ensures that my directory path is correct.
No luck. Any help would be greatly appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry I mean, I already did what cs97jim3 suggested. I will check on what springy555 suggested. Thanks!
ASKER
Double checked, already done. Anything else?
Try giving permissions to IIS_WPG local security group as well
ASKER
No such group on an IIS7 server. I gave 'everyone' full access. And this worked!
'Everyone' is a system group that includes all accounts.
I hate to give everyone full access, is it possible to pinpoint which account it is?
'Everyone' is a system group that includes all accounts.
I hate to give everyone full access, is it possible to pinpoint which account it is?
If you remove the everyone account, check the security event log for any audit failures.
The IIS_WPG group equivalent in IS7 is IIS_IUSRS. Maybe try adding that account as well.
The IIS_WPG group equivalent in IS7 is IIS_IUSRS. Maybe try adding that account as well.
this may help http://support.microsoft.com/kb/812614
ASKER
>>If you remove the everyone account, check the security event log for any audit failures.
What would an audit failure do?
Yes, in my OP, I mentioned that IIS_IUSRS was given full control allowing it do everything.
What would an audit failure do?
Yes, in my OP, I mentioned that IIS_IUSRS was given full control allowing it do everything.
Any failed logon attempts should be caught by the security log. You can then see which account failed, then give that account the correct permissions.
ASKER
Thanks to both for your contributions!
ASKER