I've done the searches but can't find the answer so a dreaded New Thread :bemused:

PHP is running as an Apache module

PHP version 5.0.4
Apache version 1.3.33 (Unix)
Operating system Linux
Kernel version 2.6.9-11.ELsmp

<?php
session_start();
$apache_headers = apache_request_headers();

Is there some setting I have missed?

    Well, as long as Apache is running as a module then it should be fine. How do you know it's running as a module?

    Just out of curiosity, have you tried getallheaders() instead?

    Do a phpinfo(); and give us the link to see it.

    🙂

      Thanks for looking, toplay.

      How do you know it's running as a module?

      I guess you mean 'how do I know PHP is running as an Apache module?'

      Only because I checked with the web host who said "Yes php is compiled into apache."

      have you tried getallheaders() instead?

      No - I am running a script that I did not write myself. I will try getallheaders() if I have to.

      sanitized phpinfo is here

        It's not running as a module. See this line in your phpinfo:

        Server API CGI

        🙂

          looks like your host is wrong. its running as a cgi. and since they use cpanel most likely they have phpsuexec turned on so that php scripts run as your username.
          you will notice the line in your phpinfo
          Server API CGI
          if it were an apache module, it would be
          Server API Apache

          the other way to tell is to look in httpd.conf and see if there is a
          LoadModule php4_module libphp4.so
          line.
          since its cgi, there is probably only
          AddType application/x-httpd-php .php

            I could have sworn there was another post in this thread a few moments ago!

            Server API CGI

            if it were an apache module, it would be
            Server API Apache

            OK - that's bad news. I guess I have to find a host that's got it set up the way I need?

            Thanks for your help.

              When I asked the host again, I got a different support tech who said:

              All our servers are running like this due to server abuse in the past
              runing in cgi mode means we can watch everything that is going on
              with the server in su-exec mode

              sorry it is not possible to change this

              Thank you for that advice about the $_SERVER superglobal array variable.

              I also found a potential workaround (untested) here in the first comment that follows the text. Not being proficient in PHP it's time to eat some books methinks.

                Write a Reply...