title: file_get_contents no such file or directory php
body: <p>I'm trying to build a php class that I can use to access my database safely, and keep my credentials away from prying eyes.  As part of the constructor I'm building an array of my credentials from a file outside of the web directory.  Unfortunately though I've tested the path using other functions in php and using vim and putty, I keep getting the same no such file or directory error when I try.</p>
  
  <p>the line that causes the error looks like this</p>
  
  <pre><code>$this-&gt;creds = explode("\n",file_get_contents("../../../../../private/mysqlinfo.ini"));
  </code></pre>
  
  <p>the folder structure on my server lookls like this</p>
  
  <pre><code>~/public_html/mysubdomain/projectDirectory/php/includes
  </code></pre>
  
  <p>the file I 'm trying to access would be here</p>
  
  <pre><code>~/private/mysqlinfo.ini
  </code></pre>
  
  <p>The following function from the same directory shows me that the directory is accurate and that the mysqlinfo.ini file does exist in the directory</p>
  
  <pre><code>$dir = "../../../../../private";
  
  if (is_dir($dir)) {
      if ($dh = opendir($dir)) {
          while(($file = readdir($dh)) !== false) {
              echo "filename:  $file || filetype: ". filetype($dir . $file) . "\n";
          }
      } else {
          echo "could not open directory";
      }
  } else {
      echo "not a directory!";
  }
  </code></pre>