title: How to access mapped network drives using PHP running in IIS
body: <p>I have this web system in PHP (5.6) and is running in IIS 8.5 Windows Server 2012 R2.
  What I wanted to do is list all the files in a directory. The directory that I'm reading is a mapped network drive of a shared folder of another server (Y:\sharedfolder). When I execute command dir of the network drive, it is not seen by the php code</p>
  
  <p>I have searched here in site and saw a lot of possible solutions but nothing work on my end. I'm not sure I'm doing them correctly. So I'll share my current settings here.</p>
  
  <p>When I ran whoami in CLI, I get "pc_name\administrator". when I execute it in code, I get "iis apppool\cs2".</p>
  
  <p>The mapped network drive (Y:\sharedfolder) is shared to the following:</p>
  
  <ul>
  <li>Everyone</li>
  <li>SYSTEM</li>
  <li>Administrator (pc_name\Administrator)</li>
  <li>Administrators (pc_name\Administrators)</li>
  <li>IIS_IUSRS (pc_name\IIS_IUSRS)</li>
  <li>CS2 (iis apppool\cs2)</li>
  </ul>
  
  <p><strong>My IIS Settings are the following:</strong></p>
  
  <p>[Authentication]</p>
  
  <ul>
  <li>Anonymous Authentication (Enabled, Credentials: Application pool identity)</li>
  <li>ASP.NET Impersonation (Disabled)</li>
  <li>Forms Authentication (Disabled)</li>
  </ul>
  
  <p>[Application Pools]</p>
  
  <ul>
  <li>CS2 (.NET CLR v4.0, Managed pipeline mode: Integrated, Identity: ApplicationPoolIdentity, Load User Profile: True)</li>
  <li>DefaultAppPool (.NET CLR v4.0, Managed pipeline mode: Integrated, Identity: ApplicationPoolIdentity, Load User Profile: True)</li>
  </ul>
  
  <p>[Fast CGI Settings]</p>
  
  <ul>
  <li>C:\php\php-cgi.exe (Protocol Tcp)</li>
  </ul>
  
  <p>[Sites: CS2]</p>
  
  <ul>
  <li>Site name: CS2</li>
  <li>Application Pool: CS2</li>
  <li>Physical Path: C:\inetpub\wwwroot\cs2</li>
  <li>Connect as 'administrator' </li>
  </ul>
  
  <p>These are all my settings yet I still couldn't access the Mapped network drive. Is there a missing or incorrect setting in my IIS?</p>