title: Including config file in PHP
body: <p>I am developing a project where I am not able to include the files.</p>
  
  <p>My Folder Structure:</p>
  
  <pre><code>--Myproject
  -----Config
  ----------config.php
  -----Includes
  ----------Images
  ---------------image.jpg
  ----------CSS
  ---------------test.css
  ----------JS
  ---------------test.js
  -----Modules
  ----------Home
  ---------------index.php
  ----------Contact 
  ----------MyPage
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/gQrcd.png" alt="enter image description here"></p>
  
  <p>I am trying to access the config file which is inside the Config/config.php in my Modules/Home/index.php</p>
  
  <p>But I am not able to include the config file?</p>
  
  <p>I tried:</p>
  
  <pre><code>1.
  define("ROOT", __DIR__ ."/");
  
  2.
  define("HTTP", ($_SERVER["HTTP_HOST"] == "localhost")
     ? "http://localhost/myproject/"
     : "http://your_site_name.com/"
  );
  &lt;img src="&lt;?php print HTTP; ?&gt;images/banner.gif"&gt;
  
  3.
  define('PROJECT_ROOT', getcwd());
  
  4.
  $_SERVER['DOCUMENT_ROOT'];
  
  Ref: [link][2]
  
  5.
  echo $_SERVER['SERVER_NAME'];
  </code></pre>
  
  <p>How can I like a config.php which is out side the folder structure but inside my project?</p>