1

ネットワーク共有スペースでコマンド openDir に問題があります

使用する:

openDir( '\\\\172.17.50.8\tsbnb_rw' );

エラーは以下のとおりです。

Warning: opendir(\\172.17.50.8\tsbnb_rw,\\172.17.50.8\tsbnb_rw) [function.opendir]: Access is denied. (code: 5)

この共有フォルダーには認証ユーザーとパスワードが必要でしたが、これを設定する方法がわかりません。

4

2 に答える 2

1

これを試すことができます:

<?php

// Define the parameters for the shell command
$location = "\\servername\sharename";
$user = "USERNAME";
$pass = "PASSWORD";
$letter = "Z";

// Map the drive
system("net use ".$letter.": \"".$location."\" ".$pass." /user:".$user." /persistent:no>nul 2>&1");

// Open the directory
$dir = opendir($letter.":/an/example/path")

...

?>
于 2013-10-09T07:53:23.370 に答える
0

マニュアルを読んでみてください。Linux での samba の場合、次の例があります。

opendir

于 2013-10-09T07:57:27.313 に答える