$_SERVER is empty

The $_SERVER array is empty and I am trying to figure out why. Could this be disabled in the php.ini file?

I am using PHP 4.3.11 on a freeBSD box running apache.

never seen that. is it an empty array or not defined?
echo isset($_SERVER);

one thing i found:

there may be a apache configuration to omit it, have a look at your httpd.conf, but as i know u’ll find nothing in the php.ini.

P.S.: please tell us if u found anything.

Thanks for the reply,

isset($_SERVER) evaluates to 1
and var_dump shows array(0) {}

I am working on an internal server of a companies network that has alot of security, so I wouldn’t be surprised if they disallowed the $_SERVER vars, but I just wasn’t sure if/how that could be done since I haven’t come across it before. I don’t think they would appreciate me putting their apache config file online so I guess I am going to have to leave it at this.

Thanks again!

Elements in the $_SERVER array shouldn’t be mandatory to the functionality of your scripts (much like AJAX actually). You might want to try contacting the administrator and see if they can get your script some privileges in the $_SERVER array though.

one thing i wanna mention here. the $_SERVER array can be trusted very mutch and it may be used to add more scurety to a script (e.g. use $_SERVER[‘REMOTE_ADDR’] to avoid session-id stealing)

so hopefully u get the admin to enable it again

Sponsor our Newsletter | Privacy Policy | Terms of Service