By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,939 Members | 1,550 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,939 IT Pros & Developers. It's quick & easy.

REMOTE_ADDR in IIS

P: n/a
Hi,

In IIS 6, windows 2003 with php 4.3.11, the code REMOTE_ADDR
does not show the IP, but the same page in apache2triad shows the
IP.
I tried
<? $ip = getenv("REMOTE_ADDR"); print $ip; ?>
and
$_SERVER['REMOTE_ADDR']

regards,

http://www.DevPlug.com --Connecting Developers
Posted from: http://www.devplug.com/ftopic57612.htm
Jul 24 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
aabrahao wrote:
In IIS 6, windows 2003 with php 4.3.11, the code REMOTE_ADDR
does not show the IP, but the same page in apache2triad shows the
IP.
I tried
<? $ip = getenv("REMOTE_ADDR"); print $ip; ?>
and
$_SERVER['REMOTE_ADDR']


Check the output of phpinfo() to see if anything useful is in there.
JW

Jul 24 '05 #2

P: n/a
aabrahao wrote:
Hi,

In IIS 6, windows 2003 with php 4.3.11, the code REMOTE_ADDR
does not show the IP, but the same page in apache2triad shows the
IP.
I tried
<? $ip = getenv("REMOTE_ADDR"); print $ip; ?>
and
$_SERVER['REMOTE_ADDR']

regards,

http://www.DevPlug.com --Connecting Developers
Posted from: http://www.devplug.com/ftopic57612.htm


The environment variables are set up by the server, and Apache and IIS don't
necessarily share the same values.

The suggestion to use phpinfo() is a good one - it will show you just what you
have in IIS - which will be different from Apache.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 24 '05 #3

P: n/a
There is the link from the IIS server:

http://www.hij.com.br/helpme/phpinfo.php

Thanks,

http://www.DevPlug.com --Connecting Developers
Posted from: http://www.devplug.com/ftopic57612.htm
Jul 25 '05 #4

P: n/a
On Mon, 25 Jul 2005 17:07:00 -0000,
ar***********@terra.com-dot-br.no-spam.invalid (aabrahao) wrote:
There is the link from the IIS server:

http://www.hij.com.br/helpme/phpinfo.php


That page shows REMOTE_ADDR set correctly under the "ISAPI" section, which
should therefore appear in $_SERVER...

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 25 '05 #5

P: n/a
Hi,

Yes, the $_SERVER['REMOTE_ADDR']; is working.
I made some changes in the windows security at the php folder,
maybe was coincidence.
But the $ip = getenv("REMOTE_ADDR"); print $ip; realy does not
work, why?
Why its works in apache2triad and don't in IIS?

Thanks,

http://www.DevPlug.com --Connecting Developers
Posted from: http://www.devplug.com/ftopic57612.htm
Jul 26 '05 #6

P: n/a
aabrahao wrote:
Why its works in apache2triad and don't in IIS?


From: http://phplens.com/phpeverywhere/node/view/32

"For ISAPI modules, the server varibles are stored in the $_SERVER array.
For CGI, they are stored as environment variables, available from the $_ENV
array or getenv( )."
JW

Jul 27 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.