php - can't include("absolute_path") -


i can't figure out why won't work.

$docroot = getenv("document_root"); include_once($docroot."/conn/connection.php"); include_once($docroot."/auth/user.php"); 

it works locally through wamp, won't work on live server. tried this:

if(!include_once($docroot."/auth/user.php")){     session_start();    $debug = array();    $debug["docroot"] = $docroot;    $debug["inc_path"] = $docroot."/auth/user.php";    $debug["file_exists"] = file_exists($debug["inc_path"]);    $_session['debug'] = $debug;     // exit    header("location:debug.php");     exit();  } 

the debug page echoes array , shows correct absolute paths , indicates file in fact exist. why didn't include_once() work? server (a dv account on mediatemple server) has not been configured @ all, wonder if there apache or php setting messing me.

ultimately, want here way refer file in such way if move file, or include in file, nothing break. ideas?

in debugging might try is_readable($docroot."/conn/connection.php"). file_exists function return true if file not have readable permissions.

if error code might able provide more info going wrong.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -