httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Montague <m...@catseye.org>
Subject Re: questions about document_root
Date Thu, 08 Dec 2011 04:55:19 GMT
On December 7, 2011 23:23 , Rui Hu <tchrbupt@gmail.com> wrote:
> I looked up the code of PHP and apache2, and found that PHP gets 
> docroot from environment var "$DOCUMENT_ROOT". However in apache, I 
> cannot find any code which assign this var.
>
> I googled but got nothing. Can you please show me the detailed process 
> generating $DOCUMENT_ROOT in $_SERVER from apache to php. Thank you 
> very much!

If you invoke PHP as a CGI, then Apache HTTP Server sets DOCUMENT_ROOT 
in the function ap_add_common_vars() which is in the file 
server/util_script.c

See line 237,

https://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/server/util_script.c?revision=1100216&view=markup


--
   Mark Montague
   mark@catseye.org


Mime
View raw message