ID:               41927
 Updated by:       [EMAIL PROTECTED]
 Reported By:      fskbcb at puk dot ac dot za
-Status:           Open
+Status:           Bogus
 Bug Type:         Network related
 Operating System: Windows XP
 PHP Version:      5.2.3
 New Comment:

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Dup of #41926.


Previous Comments:
------------------------------------------------------------------------

[2007-07-08 18:45:30] fskbcb at puk dot ac dot za

Description:
------------
I am unable to access a shared directory on another windows pc by
executing the windows "dir \\remoteserver\sharedir" function in php.

I have tried this using exec(),system() etc.

When I type the command "dir \\remoteserver\sharedir" on the windows
command line (cmd) it works fine. If I do a "dir \\ownserver\sharedir"
of the shares of the pc that I am working on, I am able to view them. It
seems that when php executes the command to read another pc's shares,
there may be permission problems?

Reproduce code:
---------------
<?php
/* Please change server name and directory name to
relevant windows share */
$server_name="radio";
$server_name="radio";
$directory_name="photos";
$share="\\\\".$server_name."\\".$directory_name;

$cmd=array(
"net use ".$share,
"dir ".$share);

for ($x=0;$x < count($cmd);$x++) {

echo "Command: ".$cmd[$x]." <br>";
$result = `$cmd[$x]`;
echo "The result is: <br>".$result." <br>";

}

?>

Expected result:
----------------
Command: net use \\radio\photos
The result is:
Local name Remote name \\radio\photos Resource type Disk Status OK #
Opens 0 # Connections 1 The command completed successfully.
Command: dir \\radio\photos
The result is: 
Volume in drive \\radio\photos is Spare Volume Serial Number is
4C41-9557 Directory of \\radio\photos 05/07/2007  06:13 PM    <DIR>     
    . 05/07/2007  06:13 PM    <DIR>          ..

etc . . . . .

Actual result:
--------------
Command: net use \\radio\photos
The result is:
Local name Remote name \\radio\photos Resource type Disk Status OK #
Opens 0 # Connections 1 The command completed successfully.
Command: dir \\radio\photos
The result is:


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41927&edit=1

Reply via email to