相对的:
PHP is_dir 和 mkdir 在映射的网络驱动器上不起作用
我知道这是很老派的,但我就是想不通...
在带有 wamp(apache 2.2、PHP 5.3.10)的 Windows 2003 上作为服务运行。按照上面的链接,我已经让它运行Administrator
而不是SYSTEM
. 但仍然没有运气。
我做了一个.bat
文件来说明清楚:
@echo off
whoami
net use
php -r "var_dump(scandir('Z:\\'));"
php -r "var_dump(scandir('\\\\192.168.211.86\\voice'));"
php -r "var_dump(scandir('//192.168.211.86/voice'));"
如果我运行它cmd
,结果是:
serv2003\administrator
New connections will be remembered.
Status Local Remote Network
-------------------------------------------------------------------------------
OK R: \\192.168.211.86\voice Microsoft Windows Network
OK Z: \\192.168.211.86\voice Microsoft Windows Network
The command completed successfully.
array(5) {
[0]=>
string(1) "."
[1]=>
string(2) ".."
[2]=>
string(6) "Folder"
}
array(5) {
[0]=>
string(1) "."
[1]=>
string(2) ".."
[2]=>
string(6) "Folder"
}
array(5) {
[0]=>
string(1) "."
[1]=>
string(2) ".."
[2]=>
string(6) "Folder"
}
但如果我在 Apache 中运行它:
<body><pre>
<?php
echo `C:\path\to\test.bat`;
?>
</pre></body>
它输出:
serv2003\administrator
New connections will be remembered.
Status Local Remote Network
-------------------------------------------------------------------------------
Unavailable Z: \\192.168.211.86\voice Microsoft Windows Network
The command completed successfully.
Warning: scandir(Z:\): failed to open dir: No such file or directory in Command line code on line 1
Warning: scandir(): (errno 2): No such file or directory in Command line code on line 1
bool(false)
Warning: scandir(\\192.168.211.86\voice): failed to open dir: No such file or directory in Command line code on line 1
Warning: scandir(): (errno 2): No such file or directory in Command line code on line 1
bool(false)
Warning: scandir(//192.168.211.86/voice): failed to open dir: No such file or directory in Command line code on line 1
Warning: scandir(): (errno 2): No such file or directory in Command line code on line 1
bool(false)
请注意,是的R:
,Apache 模块中缺少驱动程序,但由于我正在访问Z:
,我认为这不是问题。
我无权访问远程文件夹,也无法将所有文件复制到本地系统。我所需要的只是能够在 PHP 中阅读它们。我能做些什么?
提前致谢!
编辑 1:
不确定这是否重要,但我正在通过远程桌面访问此服务器(它在地理位置上离我很远)。
并且\\192.168.211.86\voice
使用用户名/密码进行映射。
以上所有练习都是在同一个登录会话中运行的。