title: PHP Fatal Error: failed opening required
body: <p>I have a script called 'sess-start.php' which lies in an /include directory within my httpdocs directory.</p>
  
  <p>My site continues to give this error:\</p>
  
  <blockquote>
    <p>[Fri Mar 25 14:52:24 2011] [error]
    [client 12.3.3.3] PHP Fatal error: 
    require() [function.require]:
    Failed opening required
    '/includes/sess-start.php'
    (include_path='.:') in
    /var/www/vhosts/site.com/httpdocs/page.php
    on line 4, referer:
    <a href="https://www.site.com/" rel="noreferrer">https://www.site.com/</a></p>
  </blockquote>
  
  <p>even though www.site.com/includes DOES exist. What gives!</p>
  
  <h2>Edit 1</h2>
  
  <p>These are includes/requires which may themselves contain additional require or include statements. Relative paths WILL NOT WORK so please do not suggest such.</p>
  
  <p>My .htaccess file already points all include paths to the site root directory:</p>
  
  <blockquote>
    <p>php_value include_path
    .:/var/www/vhosts/site.com/httpdocs</p>
  </blockquote>
  
  <h2>Edit 2</h2>
  
  <p>Not all of my include or required scripts are contained with a single directory so suggesting to simply place the /includes directory in the include_path is negated as well (and in turn also causes problems on a windows machine)</p>
  
  <h1>Update</h1>
  
  <p>Perhaps some clarification on a real-life example may help to resolve the issue our team is trying to solve for:</p>
  
  <p>On one page, a user may enter a number of options, the following page makes its necessary calculations and based on that will route the customer in a number of potential options, all which lead to require statements for something like a DB entry.</p>
  
  <p>Then, within the db entry (or some other action) if everything goes smoothly, the member may have chosen before to receive an email confirmation based on his/her action. This require statement lies within the 2nd require (db insert) but is in a different directory than the second and thus causing conflict given the first file treats the linking incorrectly.</p>
  
  <p>Hard coding the absolute path or even setting the appropriate include path per page is 'ok' but then it disables our team's ability to hotlink between files with dreamweaver (or any other program that does the same) because it does not recognize a 'site root' when running in a test environment.</p>