Previous Next

Thread: Using DOCUMENT_ROOT in FastCGI environment

Last post 01-31-2007 5:24 PM by mvolo. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 11-04-2006, 9:43 AM

    • SoHoAlex
    • Top 75 Contributor
    • Joined on 11-01-2006, 12:25 PM
    • Posts 47

    Using DOCUMENT_ROOT in FastCGI environment

    One of the lacking things about FastCGI is not being able to use

    <?php echo $_SERVER["DOCUMENT_ROOT"];?>

    Afaik this is because PHP can't request the document_root, because the PHP CGI is already resident in memory. Will this be addressed, or is this behaviour by design?

    Alex Schoenmaker, SoHosted
    Platform: Windows Server 2003 (SP2), IIS6, PHP4 and PHP5.
  • 11-04-2006, 5:30 PM In reply to

    • mvolo
    • Top 10 Contributor
    • Joined on 09-17-2003, 9:48 AM
    • Philadelphia, PA
    • Posts 583

    Re: Using DOCUMENT_ROOT in FastCGI environment

    Alex,

    We are probably missing certain variables that other PHP hosts may be providing (per http://us2.php.net/reserved.variables, the $_SERVER variable contains a list of web server specific variables, standardized only by the original CGI specification which doesn't mention the DOCUMENT_ROOT variable). 

    This is something we will address in a future release.  Do you have any pointers (aside from the link above) as to what variables are typically supported?

    Thanks,

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 11-04-2006, 8:01 PM In reply to

    • SoHoAlex
    • Top 75 Contributor
    • Joined on 11-01-2006, 12:25 PM
    • Posts 47

    Re: Using DOCUMENT_ROOT in FastCGI environment

    No Mike, sorry. All I know is that document_root requests the homedir that has been setup per website in IIS6. This does work in php4isapi.dll.

    The reason I ask about this is because it would make migrating from ISAPI to FastCGI alot easier when hosting a huge amounth of domains. -- People wouldn't have to change their existing scripts.

    Alex Schoenmaker, SoHosted
    Platform: Windows Server 2003 (SP2), IIS6, PHP4 and PHP5.
  • 12-08-2006, 9:35 AM In reply to

    • pboling
    • Not Ranked
    • Joined on 12-08-2006, 1:46 PM
    • Indianapolis, IN
    • Posts 4

    Re: Using DOCUMENT_ROOT in FastCGI environment

    The link refers to PHP_AUTH_USER which makes sense for PHP.  A more generic term is more common in other frameworks I think.  AUTH_USER is what I would expect to use in RubyOnRails, and I think IIS already provides this variable when using NTLM authentication.  Making sure that this AUTH_USER is available in the FastCGI environment then, would be appreciated.
    --
    My blog: http://galtzo.blogspot.com
  • 01-31-2007, 4:44 PM In reply to

    • SoHoAlex
    • Top 75 Contributor
    • Joined on 11-01-2006, 12:25 PM
    • Posts 47

    Re: Using DOCUMENT_ROOT in FastCGI environment

    Using document_root works great now with IIS6-FastCGI-TechPreview2-x86. Thanks!
    Alex Schoenmaker, SoHosted
    Platform: Windows Server 2003 (SP2), IIS6, PHP4 and PHP5.
  • 01-31-2007, 5:24 PM In reply to

    • mvolo
    • Top 10 Contributor
    • Joined on 09-17-2003, 9:48 AM
    • Philadelphia, PA
    • Posts 583

    Re: Using DOCUMENT_ROOT in FastCGI environment

    Great to hear!  Thanks for letting us know,
    This posting is provided "AS IS" with no warranties, and confers no rights.
Page 1 of 1 (6 items)
Page view counter