GETENV does not get any environment since upgrade...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
derschamane
Forum Newbie
Posts: 6
Joined: Fri Dec 27, 2002 1:44 pm
Location: Austria
Contact:

GETENV does not get any environment since upgrade...

Post by derschamane »

I have a script with the GETENV function, where i read some Environment Variables like REMOTE_ADDR.
It worked perfectly on IIS5.0 and php 4.3.2.
Now my friend, who is the owner of the server has upgraded to IIS6.0
and php 4.3.4. Since this I don't get any environment information.
The function GETENV delivers empty strings.

Any IDEAS and suggestions are very welcome...

Ewald, der.moderne.Schamane
http://www.schamane.cc

dermoderneschamane@yahoo.de
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Not a solution but..

To be honest, i wouldn't use the GETENV function, i would get the environment variables using the $_SERVER varaible.

Code: Select all

$_SERVER["REMOTE_ADDR"]
Mark
User avatar
derschamane
Forum Newbie
Posts: 6
Joined: Fri Dec 27, 2002 1:44 pm
Location: Austria
Contact:

Does not help...

Post by derschamane »

Thanks for the tipp, but as long as the SERVER does not deliver any Variables, $_SERVER does not work. As you said... not a solution...

ANYWAY, THANKS FOR YOUR FAST ANSWER,
Ewald
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

$_SERVER may return the information that GETENV isn't. GETENV can be disabled.

Try the code i gave in my previous post and see if it returns anything.

Mark
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Always a plan to do:

Code: Select all

echo '<pre>';
print_r($_SERVER);
echo '</pre>';
when you change webserver to check on the variables you have access to and those that may no longer be available.

Mac
User avatar
derschamane
Forum Newbie
Posts: 6
Joined: Fri Dec 27, 2002 1:44 pm
Location: Austria
Contact:

THANK YOU... $_SERVER works

Post by derschamane »

I PROMISE, that next time, I first TRY, and then REPLY ;-)
$_SERVER works perfect and delivers the information I need.

Thank you for your fast and helpful responses.

Regards
Ewald, derSchamane
http://www.schamane.cc
Post Reply