Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a hyper-v server with 3 instances running under it, testing, production, and files. The production user can access the mounted files directory with the following permissions; 'read & execute', 'list folder contents', and 'read'. The testing server's user has the same permissions but can't read them.

The error in my PHP logs is

[09-Mar-2012 06:40:07] PHP Warning: file_get_contents(\\Web\Data\files\thumbs\img123.png) >[function.file-get-contents]: failed to open >stream: Permission denied in C:\inetpub\wwwroot\testing\test.php on line 2

My PHP script is

$jpg = file_get_contents('\\\Web\Data\files\thumbs\img123.png');

Are there other settings I'm missing? The PHPInfo says the username is 'test1$'; could the IIS be trying to access the files as a different user?

Thanks.

share|improve this question
add comment

1 Answer

Take a look at the settings for:

  • The Application Pool Account - this might be set to run as a different user

  • The Authentication -> Anonymous -> Settings (if you're using anonymous authentication)

  • Authentication settings in general if you're expecting the user to authenticate and this to then happen on behalf of the user.

You mentioned "mounting" which could indicate that impersonation is being attempted and failing (which would cause the App Pool account's network identity to be used; that'll probably work out to being Test1$/the computer account, in most cases).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.