title: PHP: Error Accessing Network Directory
body: <p>Helo there,</p>
  
  <p>I'm trying to write an application that reads the contents of a folder mapped on the network, but I just can't figure what I'm doing wrong. The target server don't have Apache, IIS or nothing like that, but I think that doesn't matter, right? I can navigate in the folder without any problem using the Windows Explorer.</p>
  
  <p>Anyway, here is my code:</p>
  
  <pre><code>&lt;?php
  error_reporting(-1);
  
  $isFolder1 = opendir("\\\\MVM-VIRTUAL04\\");
  $isFolder2 = opendir("\\\\MVM-VIRTUAL05\\WORK\\");
  var_dump($isFolder1); //bool(false)
  var_dump($isFolder2); //resource(3) of type (stream) 
  ?&gt;
  </code></pre>
  
  <p>And it shows the following errors:</p>
  
  <pre><code>Warning: opendir(\\MVM-VIRTUAL04\,\\MVM-VIRTUAL04\) [function.opendir]: The specified path is not valid.. (code: 161) in xxx on line 4
  
  Warning: opendir(\\MVM-VIRTUAL04\) [function.opendir]: failed to open dir: No error in C:\xampp\htdocs\Lab\fopen.php on line 4
  
  bool(false) resource(3) of type (stream) 
  </code></pre>
  
  <p>As far that I know, both server have a very similar structure, but I really don't know what to do anymore. The XAAMP and the Apache in my machine are running as an Administrator in a Windows 7 64 Bits.</p>
  
  <p>I've tried to use <strong>system</strong>, (because the server is restricted, but I have full access) but it also do not work.</p>
  
  <pre><code>system('net use X: "\\x-drive\public" password1 /user:username /persistent:no');
  $isFolder(is_dir("x:/"));
  echo($isFolder); //FALSE
  </code></pre>