title: glob is returning no results when trying to get files from a relative path
body: <p>My application is running on IIS and the physical directory structure looks something like this:</p>
  <pre><code>C:\inetpub\wwwroot\myApplication\index.php
  C:\inetpub\wwwroot\myApplication\includes\myfunctions.php
  C:\inetpub\wwwroot\myApplication\includes\import_data\users\
  </code></pre>
  <p>That last folder contains 978 .cgi files which I'm trying to read data from.</p>
  <p><code>index.php</code> includes <code>includes/myfunctions.php</code> and makes a call to the one method in it -- <code>CheckForUsersToImport()</code> which is defined like so:</p>
  <pre><code>function CheckForUsersToImport()
  {
      $usersDir = &quot;import_data/users/&quot;;
  
      $globRes = glob($usersDir . &quot;*.cgi&quot;);
      var_dump($globRes);
      
      echo &quot;End CheckForUsersToImport();&quot;;
  }
  </code></pre>
  <p>When I navigate to <code>localhost/myApplication/index.php</code> in my browser, I get this output:</p>
  <blockquote>
  <p>array(0) { } End CheckForUsersToImport();</p>
  </blockquote>
  <p>I tried changing the second line of code to be simply <code>$globRes = glob(&quot;*.cgi&quot;);</code> but this yields the exact same output.</p>
  <p>I found <a href="https://stackoverflow.com/questions/1368340/php-doesnt-scan-relative-path-for-files">this question</a> but the accepted answer did not work for me.</p>
  <p>I've tried:</p>
  <pre><code>$usersDir = &quot;./import_data/users/&quot;;
  $usersDir = &quot;/import_data/users/&quot;;
  $usersDir = &quot;import_data/users/&quot;;
  </code></pre>
  <p>But all 3 give me the exact same output as the code above.</p>
  <p>How can I get all files with an extension of <code>&quot;.cgi&quot;</code> in a directory two levels 'beneath' the function which is executing?</p>
  <p>EDIT:</p>
  <p>I updated my function as follows:</p>
  <pre><code>function checkUserData()
  {
      $usersDir = &quot;import_data/users&quot;;
      $globRes = scandir($usersDir);
  }
  </code></pre>
  <p>When this runs, I get the following output:</p>
  <blockquote>
  <p>[phpBB Debug] PHP Warning: in file [ROOT]/includes/myfunctions.php on line 5: scandir(import_data/users,import_data/users): The system cannot find the path specified. (code: 3)</p>
  <p>[phpBB Debug] PHP Warning: in file [ROOT]/includes/myfunctions.php on line 5: scandir(import_data/users): failed to open dir: No such file or directory</p>
  <p>[phpBB Debug] PHP Warning: in file [ROOT]/includes/myfunctions.php on line 5: scandir(): (errno 2): No such file or directory</p>
  </blockquote>
  <p>Why is it looking for <code>scandir(import_data/users,import_data/users)</code> in that first error? That's not at all what I passed -- or at least, not what I think I passed -- to <code>scandir()</code>!</p>