$_SERVER['REMOTE_ADDR'] same as $_SERVER['SERVER_ADDR']

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
gatekeeper
Forum Newbie
Posts: 2
Joined: Fri Apr 04, 2008 1:32 am

$_SERVER['REMOTE_ADDR'] same as $_SERVER['SERVER_ADDR']

Post by gatekeeper »

I have revised PhpFreeChat in my host, and it was working fine there.
Then, my contact installed it in his server and this problem showed up.

$_SERVER['REMOTE_ADDR'] returns the same value as his host address,
$_SERVER['SERVER_ADDR'].

I think this has something to do with some misconfiguration in either
Apache or Php, I just wasn't sure what it is.

Is there anything I can do to fix this problem? or is there a way how I
can get the client's IP in any way possible?

Here is a phpinfo() in his host -->
http://doujin-moe.com/chat2/servertest.php

Here is a phpinfo() in my host -->
http://www.gpdesignsph.com/dah/servertest.php
User avatar
mchaggis
Forum Contributor
Posts: 150
Joined: Mon Mar 24, 2003 10:31 am
Location: UK

Re: $_SERVER['REMOTE_ADDR'] same as $_SERVER['SERVER_ADDR']

Post by mchaggis »

Looks to me like there is some form of poxy server as the $_SERVER['SERVER_PORT'] is 8080 and this would explain what the REMOTE_ADDR is the same as the SERVER_ADDR

Could it be that the server is configured for both PHP4 and PHP5 and so they have used the proxy to load the PHP5 server. Sorry , just shooting in the dark.

Unfortunately, from a code point of view there seems to be nothing that you could do to get round this.
Post Reply