1

在尝试访问虚拟文件夹中的内容几周后,我的问题是:

我有两个用于负载平衡的网络服务器。我有一个用于上传文件的存储服务器。我为具有正确权限的存储创建了一个域用户。在 IIS6 中的我的 PHP-webapp 中,我创建了一个虚拟目录,该目录通过 UNC 路径指向存储,其中“连接为”特权用户。虚拟目录名为“upload2”。

从我的 php 脚本中,我尝试使用 scandir 访问 upload2 文件夹(用于读取/写入)或尝试使用 fopen 写入文件。在 IIS 中,我可以浏览/查看虚拟文件夹中的内容。但是php说

'警告:scandir(upload2,upload2) [function.scandir]:系统找不到指定的文件。(代码:2)在 E:\inetpub\wwwroot\pvmonitor\test2.php 第 25 行警告:scandir(upload2) [function.scandir]:无法打开目录:E:\inetpub\wwwroot 中没有这样的文件或目录\pvmonitor\test2.php 第 25 行

通过执行脚本:

$filename='upload2';
$dir    = $filename;
$files1 = scandir($dir);
print_r($files1);

我如何将 php 指向这个虚拟文件夹?

4

1 回答 1

2

PHP cannot access a virtual dir because it is virtual, it is only used by the website, you need to read/write the actual physical path that the vdir points to.

于 2013-09-02T18:41:33.033 回答