title: Can't get the right include path in PHP
body: <p>I read some other related questions and thought this was the best answer:</p>
  
  <pre><code>set_include_path(get_include_path().PATH_SEPARATOR."/path/to/program/root");
  </code></pre>
  
  <p>However, I can't get it to the right directory and the error messages aren't helpful enough, so I'm lost. My user area directory (shared host) looks like this:</p>
  
  <pre><code>/home/linweb09/b/example.com-1050560306/user    # &lt;-- this is my root
  </code></pre>
  
  <p>I was trying to re-organise my program so that all of the model files go in this directory:</p>
  
  <pre><code>{root}/program_name/library/
  </code></pre>
  
  <p>The web-root folder is this:</p>
  
  <pre><code>{root}/htdocs/
  </code></pre>
  
  <p>So I changed all of my includes to look like this:</p>
  
  <pre><code>set_include_path(get_include_path().PATH_SEPARATOR
                   ."/home/linweb09/b/example.com-1050360506/user");
  require_once "/program_name/library/some_module.php";
  </code></pre>
  
  <p>The index has to load this include to work, to authenticate the user:</p>
  
  <pre><code>/htdocs/admin/authenticate.php
  # index.php
  set_include_path(get_include_path().PATH_SEPARATOR
                   ."/home/linweb09/b/example.com-1050360506/user");
  require_once "/htdocs/admin/authenticate.php";
  </code></pre>
  
  <p>And I run into these errors:</p>
  
  <blockquote>
    <p>[warn] mod_fcgid: stderr: PHP Fatal error:<br>
    require_once() [function.require]: Failed opening required '/htdocs/admin/authenticate.php'<br>
    (include_path='.:/usr/share/pear:/usr/share/php:/home/linweb09/b/example.com-1050360506/user')<br>
    in /home/linweb09/b/example.com-1050360506/user/htdocs/admin/index.php on line 3</p>
    
    <p>[warn] mod_fcgid: stderr: PHP Warning:<br>
    require_once(/htdocs/admin/authenticate.php) [function.require-once]: failed to open stream:<br>
    No such file or directory in<br>
    /home/linweb09/b/example.com-1050360506/user/htdocs/admin/index.php
    on line 3</p>
  </blockquote>
  
  <p>But it is in the correct location and the error says no such file or directory, so I'm not sure how I'm supposed to configure this.</p>
  
  <p>I also tried these and I got the same errors:</p>
  
  <pre><code>set_include_path(get_include_path().PATH_SEPARATOR."/user");
  set_include_path(get_include_path().PATH_SEPARATOR."/");
  </code></pre>