使用PHP5.2 + IIS7.5访问networking共享

我正在使用PHP 5.2与IIS7.5。

我有一个networking共享NAS是用户名和密码保护。 我无法禁用或更改NAS上的身份validation信息。 我需要能够通过PHP访问该networking共享。

我做了以下几点:

  1. 在用户名和密码与NAS相匹配的Windows中创build新用户。
  2. 创build使用相同的身份validation信息的IIS应用程序池。
  3. 使用相同的authentication信息,在打开模拟的php应用程序目录内创build一个web.config文件。

    identity impersonate =“true”password =“ThePass”userName =“TheUser”/>

  4. 在IIS中的应用程序身份validation中启用ASP.NET模拟。

这似乎并没有在php这个简单的代码行:

$dir = opendir("\\\\someservername\\somesharename"); 

警告:opendir(\ someservername \ somesharename)[function.opendir]:未能打开dir:第7行的C:\ websites \ site \ forum \ testing.php没有错误

所以,我决定用ASP.NETtestingconfiguration。

 string[] diretories = System.IO.Directory.GetDirectories("\\\\someservername\\somesharename"); 

asp.nettesting工作完美。

再往下走兔子洞,我跑了phpinfo()并检查了用户名信息。 在phpinfo的“环境”部分,我find了“USERNAME”项。 它的价值是“用户”,正如我所预期的那样。

一切都指向正确configuration的系统,直到我尝试了:

 echo get_current_user(); 

哪个回来了,“IUSR”。 那肯定不是我所期望的。

这个问题可以很容易地交叉发布到stackoverflow,但我认为这是一个configuration问题。

那么,如何在世界上获得PHP + IIS7.5从外部networking共享读取?