亲属:
Service not able to access a mapped drive
dir and mkdir not working on mapped network drive
我知道这是个古老的学校,但我就是搞不懂.
在Windows 2003上,wamp (Apache2.2,PHP5.3.10)作为服务运行。按照上面的链接,我已经将其运行为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)注意,是的,Apache模块中缺少一个R:驱动程序,但是由于我正在访问Z:,我认为这不是问题所在。
我无法访问远程文件夹,也无法将所有文件复制到本地系统。我所需要的只是在PHP中读取它们的能力。我能做什么?
提前感谢!
编辑1
不确定这是否重要,但我正在通过远程桌面访问这台服务器(它在地理上离我很远)。
\\192.168.211.86\voice使用用户名/密码来映射。
所有上述实践都在同一个登录会话中运行。
发布于 2012-10-07 01:33:43
尝试手动安装Apache、PHP和MySQL。有一次,当我尝试使用Curl (在PHP模式下)运行代码时,我对WAMP感到非常头疼,并且花了几天时间来调查问题所在,因为那天我甚至从未在任何测试环境中安装预包包。
此链接将指导您:manually
检查服务器防火墙。
发布于 2013-07-07 21:44:33
设置所有的服务是不必要的。wamp和apache的问题在于,当您使用网络驱动器时,apache无法启动,在这种情况下,wamp的颜色通常是黄色的,否则apache会出错。以确保使用cmd行打开httpd.exe。您将看到一个错误“驱动器找不到,apache无法启动等等”。毕竟,可能是因为您意识到问题在于wamp上的apache无法作为服务启动。这份文件会帮你的。
https://stackoverflow.com/questions/12576301
复制相似问题