我有一个连接到 Linksys 路由器的闪存驱动器(或硬盘)并将其设置为无需登录即可访问。然后我在计算机上设置网络驱动器(Windows 7 Proffesional x64)。我试过 opendir(\192.168.1.1); 但我收到了这个错误
Warning: opendir(\\192.168.1.1\s2,\\192.168.1.1\s2): The network name cannot be found. (code: 67) in C:\xampp\htdocs\movies.php on line 4
Warning: opendir(\\192.168.1.1\s2): failed to open dir: No such file or directory in C:\xampp\htdocs\movies.php on line 4
Warning: readdir() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\movies.php on line 5
然后我在 php.net opendir 评论中尝试了几个技巧,但是当我尝试以我的帐户登录 apache 时,我遇到了错误:
Windows could not start the apache2.4 service on Local Computer Error 1069: The service did not start due to a logon failure.
PHP代码:
$path = '\\192.168.1.1\\s2';
$dir = opendir($path);
while($temp = readdir($dir))echo $temp;
编辑:好吧,我让 apache 登录了我为此目的专门创建的管理员帐户,但我仍然收到此错误:
Warning: opendir(\\192.168.1.1\s2\,\\192.168.1.1\s2\): The network name cannot be found. (code: 67) in C:\xampp\htdocs\movies.php on line 4