Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在windows中使用PHP将文件从一个驱动器复制到另一个驱动器_Php_Windows_Copy - Fatal编程技术网

无法在windows中使用PHP将文件从一个驱动器复制到另一个驱动器

无法在windows中使用PHP将文件从一个驱动器复制到另一个驱动器,php,windows,copy,Php,Windows,Copy,我尝试使用PHP创建一个文件,并尝试使用以下代码将创建的文件复制到另一个驱动器 <?php $file = 'C:\xampp\htdocs\testfile.txt'; $myfile = fopen( $file, "w") or die("Unable to open file!"); $txt = "This is a test"; fwrite($myfile, $txt); fclose($myfile); copy($file,'Y:\test.txt'); PHP用户是否

我尝试使用PHP创建一个文件,并尝试使用以下代码将创建的文件复制到另一个驱动器

<?php
$file = 'C:\xampp\htdocs\testfile.txt';
$myfile = fopen( $file, "w") or die("Unable to open file!");
$txt = "This is a test";
fwrite($myfile, $txt);
fclose($myfile);
copy($file,'Y:\test.txt');

PHP用户是否有权复制到该驱动器上的文件夹?@JayBlanchard它是一个网络映射驱动器,仅仅因为它被映射并不意味着PHP脚本有权写入它。IUSR帐户无法使用映射。您知道如何检查它吗?PHP在IUSR帐户下运行。