$_SERVER["DOCUMENT_ROOT"] returns null or blank

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akshaygvyas
    New Member
    • Jul 2011
    • 1

    $_SERVER["DOCUMENT_ROOT"] returns null or blank

    Hi,

    I am trying to include some php files in one of my php page. It errors out saying:

    Code:
    Warning: include(/apps1/includes/getINIParamVal.php) [function.include]: failed to open stream: No such file or directory in D:\inetpub\vhosts\aadityatech.in\httpdocs\apps\apps1\index.php on line 9
    
    Warning: include() [function.include]: Failed opening '/apps1/includes/getINIParamVal.php' for inclusion (include_path='.;./includes;./pear') in D:\inetpub\vhosts\aadityatech.in\httpdocs\apps\apps1\index.php on line 9
    I checked twice, and found that my getINIParamVal. php in D:\inetpub\vhos ts\aadityatech. in\httpdocs\app s\apps1\include s.

    I suspect that $_SERVER["DOCUMENT_R OOT"] variable returns the null value. I have included the file with following line:
    Code:
    include($_SERVER["DOCUMENT_ROOT"] . "/app1/includes/" . "getINIParamVal.php");
    My document root in apache is:
    D:\inetpub\vhos ts\aadityatech. in\httpdocs\app s

    Please help. I would highly appreciate.

    Thanks,
    Akshay
  • Chris T
    New Member
    • Jul 2011
    • 5

    #2
    at first look there's a mistake where you write /app1 in your include. There should be /apps1 , right ?

    Comment

    Working...