Page 1 of 1

Global variables are not working

Posted: Wed Nov 20, 2002 4:59 am
by rajeshb
Hello All,

We have upgraded to php 4.2.2 version from a previous version.

In the old version we used getenv("HTTP_HOST") to find out the host name and it worked well. But after the upgrade it is not giving any result to us. At the same time i am able to get the result with $_SERVER["HTTP_HOST"]. As i could not change all the previous code, I would like to get the value using getenv("HTTP_HOST") it self.

Here are the list of params from my php.ini file
register_globals = On
variables_order = "EGPCS"
gpc_order = "GPC"

Can some body tell me what went wrong ?

Thanks,
Rajesh B.

Posted: Wed Nov 20, 2002 9:00 am
by BDKR
When I do a phpinfo() on a test page, then search for HTTP_HOST, it only shows $_SERVER["HTTP_HOST"] as on option for getting the info that you need. However,
doing a getenv() as you did works on my box.

In my php.ini, the settings are
register_globals = Off
variables_order = "EGPCS"
gpc_order = "GPC"

Now if I change register_globals to On, it still works.

:?:

I'm going to look at a couple of other things.

Cheers,
BDKR

Posted: Wed Nov 20, 2002 9:04 am
by BDKR
Hey,

Let's get some more info about your setup. Are you running ISAPI mode? Are you on a Linux or other Boxen? Yada yada yada....

Cheers,
BDKR

Posted: Fri Nov 29, 2002 7:05 am
by rajeshb
Hi,

Actually we were working with RedHatLinux 7.3 and PHP was working fine. we updated the server to 8.0 RedHatLinux and it automatically updated php to 4.2.2 . after that this getenv() function is not working.

It seems we are missing some configuration...

By the way .. what is ISAPI mode...please enlighten me..


Thanks
Rajesh B.