相対的:
PHP is_dir と mkdir がマップされたネットワーク ドライブで動作しない
私はこれが非常に古い学校であることを知っていますが、それを理解することはできません...
Windows 2003 で wamp (Apache 2.2、PHP 5.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)
確かにR:
、Apache モジュールにドライビングがありませんが、私は にアクセスZ:
しているので、それは問題ではないと思います。
リモート フォルダへのアクセス権がなく、すべてのファイルをローカル システムにコピーできません。必要なのは、PHP でそれらを読み取る機能だけです。私に何ができる?
前もって感謝します!
編集1:
これが問題かどうかはわかりませんが、リモート デスクトップ経由でこのサーバーにアクセスしています (地理的に離れています)。
そして、\\192.168.211.86\voice
ユーザー名/パスワードを使用してマップします。
上記のすべてのプラクティスは、同じログイン セッションで実行されます。