title: PHP include relative path
body: <p>I have file  /root/update/test.php. There's also a file, /root/connect.php; This file has a line </p>
  
  <pre><code>include "../config.php";
  </code></pre>
  
  <p>In /root/update/test.php. There's the code</p>
  
  <pre><code>set_include_path(".:/root");
  include "connect.php";
  </code></pre>
  
  <p>When I run /root/update/test.php, it finds connect.php, but fails to find config.php, giving me </p>
  
  <pre><code>PHP Warning:  include(../config.php): failed to open stream: No such file or directory in /root/connect.php on line 2
  PHP Warning:  include(): Failed opening '../config.php' for inclusion (include_path='.:/root')
  </code></pre>
  
  <p>This is confusing to me because the warnings make it seem like I'm doing everything correctly - the include path is /root, and it's looking for file ../config.php (/config.php), which exists. Can someone clear this up for me? Note that using absolute paths is not an option for me, due to deploying to a production server that I have no access to.</p>
  
  <p>Ubuntu/Apache</p>