title: require_once failed to open stream: No such file or directory - even if relative path seems to be correct(?)
body: <p>Well, I have this dashboard.php file:</p>
  
  <pre><code>&lt;?php
  require_once ('../resources/config.php');
  ?&gt;
  </code></pre>
  
  <p>and my file tree looks like this:</p>
  
  <p>/home/name/public_html/</p>
  
  <ul>
  <li>admin/dashboard.php</li>
  <li>resources/config.php</li>
  </ul>
  
  <p>I really don't know what the heck is wrong with it, I'm using exact same include in the exact same directory for another php script, and everything runs great.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>EDIT:</strong> I've noticed that in some cases relative path for files called from the same directory on the server is different, and now I know why. I use <code>index.php</code> to control URI requests and have nicer URLs, I have a <code>switch</code> statement there which use <code>include</code> to call requested file, so if it includes a script which also has an include/require statement, the path changes.</p>
  
  <p>I'm trying to fix that now, but I'm very very beginner, so any of your advice will be extremely helpful. </p>
  
  <p>And great thanks to all of you, who answered so far!</p>