Hi everyone,

I just wanted to find out what the apache_request_headers() /
apache_response_headers() functions return on Windows IIS?
(or any other Web Server besides Apache? The PHP document
states that these functions only work on PHP installed as an
Apache module.)

Is there any other way to get the HTTP request/response header
information besides using these functions and the global $_SERVER
variable (and nsapi functions)?

    The PHP document
    states that these functions only work on PHP installed as an
    Apache module.

    I think you answered your own question.

      My guess would be false is returned by a non Apache module version of PHP (seems I'm right too:
      Return Values

      An associative array of all the HTTP headers in the current request, or FALSE on failure.

      😉 ).... but why you'd use them I'm not sure...

      Obvioulsy the safe answer is:

      Note: You can also get at the value of the common CGI variables by reading them from the environment, which works whether or not you are using PHP as an Apache module. Use phpinfo() to see a list of all of the available environment variables.

        Use phpinfo() to see a list of all of the available environment variables.

        I would really appreciate if anyone running PHP on Windows IIS can post the environment variables listed in phpinfo().
        I have a Mac and don't have a Windows so I cannot check them by myself...

        Thanks!

          I just wanted to share that I found the following:

          Apache and IIS PHP $_SERVER Superglobal Comparision

          It seems like the following $_SERVER globals are always available for both Apache and IIS:

          $_SERVER['DOCUMENT_ROOT']
          $_SERVER['HTTP_ACCEPT']
          $_SERVER['HTTP_ACCEPT_CHARSET']
          $_SERVER['HTTP_ACCEPT_ENCODING']
          $_SERVER['HTTP_ACCEPT_LANGUAGE']
          $_SERVER['HTTP_CONNECTION']
          $_SERVER['HTTP_HOST']
          $_SERVER['HTTP_KEEP_ALIVE']
          $_SERVER['HTTP_USER_AGENT']
          $_SERVER['PATH_TRANSLATED']
          $_SERVER['PHP_SELF']
          $_SERVER['REMOTE_ADDR']
          $_SERVER['REQUEST_METHOD']
          $_SERVER['SCRIPT_NAME']
          $_SERVER['SERVER_NAME']
          $_SERVER['SERVER_PORT']
          $_SERVER['SERVER_PROTOCOL']
          $_SERVER['SERVER_SOFTWARE']
          
            Write a Reply...