title: require_once path can't locate file?
body: <p>Here is my folder structure as example:</p>
  
  <pre><code>source files/
      controller/
          ctrl_showData.php
      model/
          Database.class.php
  </code></pre>
  
  <p>Suppose it's now in controller directory, and in the ctrl_showData.php, I want to require the Database.class.php, so I try:</p>
  
  <pre><code>require_once(dirname(__FILE__) .'/../model/Database.class.php');
  </code></pre>
  
  <p>But when I debug, the program stalls when it execute the statement above, which I guess it can't locate the file. I already read similar questions and tried their solutions, but none work. Any one could help? Thanks!
  Here is the echo result:</p>
  
  <pre><code>/controller/../model/Database.class.php
  </code></pre>
  
  <p>Apparently, it doesn't go the parent directory, which is the source files/, then go to the model/ , but don't know why?</p>
  
  <p>Thanks for the error message suggestions, the error message is:</p>
  
  <pre><code>Warning: require_once(config/config.php): failed to open stream: No such file or directory in /model/Database.class.php
  </code></pre>
  
  <p>Because I also require the the config.php in the database file, which the path is not correct. I didn't think about that, thank you for all your help!</p>