httpd: support env var SCRIPT_FILENAME

Paul Fox pgf at brightstareng.com
Sat Sep 3 21:23:51 UTC 2005


 > Dirk Clemens wrote:
 > 
 > >php needs the Variable SCRIPT_FILENAME.
 > >And here is the patch:
 > >
 > >@@ -1179,6 +1185,8 @@
 > >       argp[0] = strrchr( purl, '/' ) + 1;
 > >        /* but script argp[0] must have absolute path and chdiring to
 > >this */
 > >       if(realpath(purl + 1, realpath_buff) != NULL) {
 > >+           // now we can set SCRIPT_FILENAME
 > >+           addEnv("SCRIPT_FILENAME","",realpath_buff);
 > >            script = strrchr(realpath_buff, '/');
 > >            if(script) {
 > >                *script = '\0';
 > >
 > >
 > >Dirk
 > >_______________________________________________
 > >  
 > >
 > I have read and thought about this:
 > SCRIPT_FILENAME is not cgi-Standard.
 > It's more an apache feature and $0 contains the same information.
 > So I can use $0 to setup SCRIPT_FILENAME in the cgi-php-wrapper.
 > 
 > http://hoohoo.ncsa.uiuc.edu/cgi/env.html : a list of required
 > environment variables

this was bug #4 in the bug system for a very long time:
    http://bugs.busybox.net/view.php?id=4
i think rob just applied and closed it a couple of days ago. 
(the php folks clearly are never going to get around to fixing
it, given the responsiveness to this thread, in _their_ bug
system:
    http://bugs.php.net/bug.php?id=28227

paul
=---------------------
 paul fox, pgf at brightstareng.com



More information about the busybox mailing list