title: PHP include() and require() file
body: <p>I have the following files</p>
  
  <p><em>classes/Database.php</em></p>
  
  <pre><code>require_once("config/config.php");
  ...
  </code></pre>
  
  <p><em>config/config.php</em></p>
  
  <pre><code>...
  </code></pre>
  
  <p>The problem is:</p>
  
  <p><em>include/validateNick.php</em></p>
  
  <pre><code>require_once("../classes/Database.php");
  ...
  </code></pre>
  
  <p>In "include/validateNick.php" included "../classes/Database.php" but "Database.php" can't include "config/config.php", it shows a error: No such file or directory.</p>
  
  <p>I know I can change it to <code>require_once("../config/config.php")</code>, but I have other php in root folder needs to include "Database.php" (like the following)</p>
  
  <p><em>register.php</em></p>
  
  <pre><code>require_once("classes/Database.php");
  ...
  </code></pre>
  
  <p>How to solve this problem?</p>
  
  <p>Sorry if my question not clear.</p>