Visite Webhosting Latino, el site sobre alojamiento web.
#26214 : Cannot copy() files to mapped drive - Mombu the Php Forum
Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #26214 : Cannot copy() files to mapped drive
User Name
REGISTER NOW! Mark Forums Read

sponsored links

1 31st July 10:53
External User
Posts: 1
Default #26214 : Cannot copy() files to mapped drive

ID: 26214
Comment by: subsolanus at hotmail dot com
Reported By: james dot grey at bt dot com
Status: Bogus
Bug Type: Network related
Operating System: W2K
PHP Version: 4.3.3
New Comment:

This is indeed true.
As I sidenote, if you're running Apache on Windows, you can fix this
problem by running the server from the local user to which the network
drive is mapped, instead of running it as a system service.

I've had a similar problem trying to read a network file via the
include command.

Previous Comments:

[2003-11-14 06:46:02]

This is file permissions issue, not a PHP bug.


[2003-11-14 03:48:15] Leblanc at phpzipscript dot org

Do not forget that the default SYSTEM User under windows (Services run
under this user by default, like Apache) DO NOT have access to mapped
network drives. Mapped network drives are mounted for a specific user
indeed and won't work for other users.

To verify this, just logon with another login/password and you won't
see your J: drive letter if you didn't mount it for this specific user.


[2003-11-12 07:05:38] james dot grey at bt dot com

copy()Seem to fail only when the destination directory is a mapped
drive with...

also tried this...
$cmd = "copy D:\\temp\\test.csv D:\\temp\\temp_2\\test2.csv";
system($cmd, $retval)
$cmd = "copy D:\\temp\\temp_2\\test.csv
J:\\10_Operational\\INLIFESUPPORT\\HELPDESK\\test. csv";
system($cmd, $retval);

yet checking the remote location in DOS... its all ok
C:\>copy D:\temp\temp_2\test.csv
1 file(s) copied.

Reproduce code:
$filename = "test.csv";
$dir_remote = "J:\\10_Operational\\INLIFESUPPORT\\HELPDESK\\ ";
$dir_local = "D:\\temp\\";
$dir_local2 = "D:\\temp\\temp_2\\";
//works fine
copy($dir_local . $filename , $dir_local2 . $filename);
//does not work..
copy($dir_local . $filename , $dir_remote . $filename);

Expected result:
file copied to local and remote location

Actual result:
Warning: copy(J:\10_Operational\INLIFESUPPORT\HELPDESK\test .csv):
failed to open stream: No such file or directory in ...


Edit this bug report at
  Reply With Quote

  sponsored links


Thread Tools
Display Modes

Copyright 2006 - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -