Page 1 of 1

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

Posted: Fri Apr 04, 2008 1:36 am
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

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

Posted: Fri Apr 04, 2008 11:15 am
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.