Forum Moderators: coopster

Message Too Old, No Replies

Include dirs fail on production server

         

daveginorge

11:31 am on Apr 17, 2009 (gmt 0)

10+ Year Member



Hi All

I have a problem where the include_path I modify with the following code fails but only on the live server all works fine on my FC8 Apache testing server.

ini_set('include_path', ini_get('include_path') . $sep . $doc_root . '/common-include');

The error produced is below, I have removed any site names and substituted "mysite"
Warning: include(site_bar.php) [function.include]: failed to open stream: No such file or directory in /home/3/d/mysite/www/dev/dh/index.php on line 8

I have checked. The dir exists and the file exists. If I add the relative path to the include statement then it finds the file.

This works fine.

include "common-include/header.php";

This fails

$sep = PATH_SEPARATOR;
$doc_root = $_SERVER['DOCUMENT_ROOT'];
ini_set('include_path', ini_get('include_path') . $sep . $doc_root . '/common-include');
include "site_bar.php";

As this works fine on the testing server I assume it must be a permissions problem.
Does the .htaccess file have any effect here, if so what would I need to gain access to the dir's.

Any other ideas.

Thanks for taking the time to read this.
Dave

coopster

8:16 pm on Apr 24, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Print out the path before attempting to set it and be sure it looks right to you.