Takes a step out of setting up PHP for IIS.  

My understanding of the previous discussion was that cgi.force_redirect 
is not required if running under IIS.  This patch detects IIS.

One less thing to go wrong configuring under Win32 and IIS :).


Index: sapi/cgi/cgi_main.c
===================================================================
RCS file: /repository/php4/sapi/cgi/cgi_main.c,v
retrieving revision 1.158
diff -u -b -r1.158 cgi_main.c
--- sapi/cgi/cgi_main.c 12 Apr 2002 00:20:29 -0000      1.158
+++ sapi/cgi/cgi_main.c 30 Apr 2002 15:06:59 -0000
@@ -577,6 +577,14 @@
        /* check force_cgi after startup, so we have proper output */
        if (cfg_get_long("cgi.force_redirect", &force_redirect) == FAILURE) {
         force_redirect = 1;
+        {
+            /* We don't need force_cgi on if running under IIS. */
+            char* sServerSoftware = getenv("SERVER_SOFTWARE");
+            char* sExpected = "Microsoft-IIS";
+            if (sServerSoftware && (0 == 
+strncmp(sServerSoftware,sExpected,strlen(sExpected)))) {
+                force_redirect = 0;
+            }
+        }
        }
        if (cgi && force_redirect) {
         if (cfg_get_string("cgi.redirect_status_env", &redirect_status_env) == 
FAILURE) {

--
Preston L. Bannister
http://members.cox.net/preston.bannister/
pbannister on Yahoo Messenger

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to