title: Included php files wont work after moved files subfolder
body: <p>I have a problem with php include section. In order to fully explain the problem, I created a test page for you. </p>
  
  <p>First I want to show the schema of the files to you. Also you can download the test files from this <strong><a href="http://dosya.co/6s2s7b3n4aw9/appname.zip.html" rel="nofollow noreferrer">LINK</a></strong> and you can test it online <strong><a href="http://www.duhovit.com/appname/" rel="nofollow noreferrer">TEST LINK</a></strong></p>
  
  <p><a href="https://image.prntscr.com/image/Wd1vtsveRP62o50grlrIBA.png" rel="nofollow noreferrer"><img src="https://image.prntscr.com/image/Wd1vtsveRP62o50grlrIBA.png" alt="enter image description here"></a></p>
  
  <p>As you can see, there is a subfolder in the <code>htdocs</code> (root) file and all php files in there. Now I'll show you the php code within the file, respectively.</p>
  
  <p><strong><em>appname/index.php</em></strong></p>
  
  <pre><code>&lt;?php include_once 'includes/config.php';?&gt;
  &lt;div class="callPage"&gt;Click Here&lt;/div&gt;
  &lt;div id="testBox"&gt;&lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
    $(document).ready(function(){
        var siteurl = '&lt;?php echo $url;?&gt;';
        $("body").on("click",".callPage", function(){
         $.ajax({
              url: siteurl+'content/test',
              beforeSend: function() {
                  //Do something
              },
              complete:function(){
                //Do something 
              },
              success:function(response){
                  $("#testBox").html(response);
              }
              });
      });
       function LoadPage(){
         $.get(siteurl+'content/test', function(data) {
            $('#testBox').html(data);
         });
      }
      LoadPage(); 
    });
  &lt;/script&gt;  
  </code></pre>
  
  <p><strong><em>appname/content/test.php</em></strong></p>
  
  <pre><code>&lt;?php 
  include_once 'includes/config.php';
  echo $text.'&lt;/br&gt;';
  echo $worked.'&lt;/br&gt;';
  ?&gt;
  </code></pre>
  
  <p><strong><em>appname/includes/config.php</em></strong></p>
  
  <pre><code>&lt;?php 
  $url = 'http://localhost:8888/';
  $text = 'Well Come! How are you today ?';
  $worked = 'It is working :)';
  ?&gt;
  </code></pre>
  
  <p>When you open the <strong><a href="http://www.duhovit.com/appname/" rel="nofollow noreferrer">TEST LINK</a></strong>, <code>LoadPage();</code> javascript function will call <code>test.php</code> in the content file and display it in <code>#testBox</code>. First you will not see anything in <code>#testBox</code> from <code>index.php</code> . Because <code>config.php</code> can not be included from <code>test.php</code> .</p>
  
  <p>I know if I change this line <code>include_once 'includes/config.php';</code> from <code>test.php</code> like this <code>include_once '/appname/includes/config.php';</code> then problem will be fix. </p>
  
  <p>But if the pages multiply and, I want to use the files in the root (htdocs or www) folder, I need to delete appname (subfolder name) => <code>include_once 'appname/includes/config.php';</code> from all files. It will be a big problem when these files multiply.</p>
  
  <p>Actually the question is exactly:</p>
  
  <blockquote>
    <p>How can we include php files without specifying the full path to the include, when the application's path relative to the <code>DOCUMENT_ROOT</code> is variable or unknown and <code>include_path</code> cannot be reliably modified by all application users?</p>
  </blockquote>