我正在编写如下所示的 php 代码,其中我正在使用凭据连接到网络驱动器。
php代码:
$user = 'mickeymouse';
$password = 'helloworld';
exec('net use "\\\INVEST-ST-001\Video_Remap\podcast\" /user:"'.$user.'" "'.$password.'" /persistent:no'); // Access a network drive using credentials
$src_dir = ('\\\INVEST-ST-001\Video_Remap\podcast\incoming_folder');
$destination_dir = ('\\\INVEST-ST-001\Video_Remap\podcast\outgoing_folder');
exec('net use "\\\INVEST-ST-001\Video_Remap\podcast" /delete /yes'); // Then deleting it
$mp4_files = preg_grep('~\.(mp4)$~', scandir($src_dir)); // Line D
我还通过 net use 命令建立了连接:
net use "\\INVEST-ST-001\Video_Remap\podcast" /user:"mickeymouse" "helloworld" /persistent:no
我收到以下消息:
命令成功完成
我正在使用的 php 版本是:
PHP版本:5.3.28
错误:
我在网页上遇到的错误是:
该系统找不到指定的路径。(代码:3)在 W:\ahdhd\shshshs\status.php 在上面的 php 代码中的D 行。
问题陈述:
我想知道我应该在上面的 php 代码或我需要使用的任何其他网络使用命令中进行哪些更改,以便使用 php.ini 中的凭据连接到网络驱动器。
编辑:
我可以访问test目录中的所有内容,但不能访问Audio_Remap目录中的所有内容。