Re: cvs: php4 /sapi/cgi cgi_main.c
| From: | Shane Caraveo | Date: | Thu, 09 May 2002 23:22:57 +0000 |
| Subject: | Re: cvs: php4 /sapi/cgi cgi_main.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-11797@lists.php.net to get a copy of this message | ||
Hmm, ok I was wrong. Server plugins have some special environment vars, but I'm not seeing them under CGI. But we still need something very generic to handle this.
Perhaps add another directive in php.ini that is for the value of the variable defined in cgi.redirect_status_env. Then set the defaults cgi.redirect_status_env to 'SERVER_SOFTWARE', and cgi.redirect_status_env_value to 'Microsoft'. Then the logic in cgi main would be something like:
if (cgi.redirect_status_env && !cgi.redirect_status_env_value)
redirectOK = true
else if (cgi.redirect_status_env && cgi.redirect_status_env_value)
redirectOK = stristr(getenv(cgi.redirect_status_env),cgi.redirect_status_env_value) != NULL
Shane
Preston L. Bannister wrote:
OK - installed PWS on my Win98 box - the one invisible to the Internet :). Just so I'm entirely clear - what am I looking for? I was looking for some sort of on-line discussion of the issue, but I guess I'm not looking in the right place. From: Shane Caraveo [mailto:shane@caraveo.com]Preston L. Bannister wrote:From: Shane Caraveo [mailto:shane@caraveo.com]Something other than checking that an environment variable has a secific value. For Apache we don't check what the value of the vars are, but that the vars exist. The advantage of this is that if the value changes for some reason, php doesn't have to change to work with it. So find a common var that is available on the majority of MS os/web server combinations, and NOT common on other web servers (I beleive there are a couple), then make the default of cgi.redirect_status_env in php.ini that var name. Requires no code change.Not cool. I'm sure other servers also don't require force_redirect, so do we start building a large if block checking for any server that doesn't? Simply setting cgi.force_redirect=0 in php.ini fixes the problem. If something more is needed, make it generic, not specific.OK - if the goal is to make default configuration do the right thing (so the guy installing PHP has less to get wrong) what would be generic? Pragmatically there are two web servers used by the majority of sites (Apache and IIS) so building knowledge into the code rather than into the documentation for the most common cases makes everyone's life simpler. I don't mind putting this into a different form. What would you suggest?