Wrong IP address?

Kevin

Well-known member
I've been noticing lately that the IP address shown for myself from the Current Members page isn't always consistent.

To clarify... if I Google 'what is my ip' (or go to a IP site) I might get an address that ends in .101 but... if I visit 5 different XF sites I see an an address that ends in .163 on 2 out of the 5 sites.

Anybody else seeing similar oddities with the IP? If not, any thoughts on why I might be getting these results? :confused:
 
Might be a proxy messing up the IP reporting. See my posts in this thread, starting with this one:

http://xenforo.com/community/threads/always-1-guest-online.23143/#post-287651
Thanks, sounds like the same problem even though I'm not using Nginx or behind a proxy. I tried the change to config.php you posted in that thread but it results in a "An unexpected error occurred. Please try again later." error.

EDIT: Viewing the PHP Info page the right address is shown for REMOTE_ADDR in the Apache Environment section but not for _SERVER["REMOTE_ADDR"] in the PHP Variables section. There is no HTTP_X_REAL_IP variable listed which is likely causing my error when I try the change to the config file.
 
Do you see your correct IP address anywhere on the PHP info page? It might be in a different server variable.
I was thinking the same... :D There are only a few IP addresses listed and, excluding the server IP, I only have REMOTE_ADDR available as a PHP variable. I checked the same thing on one of the sites that is working (same server, nearly identical config file with the differences being the cache prefix & DB settings of course) and there it is correct in both spots (Apache environment & PHP variable).
 
Well if you can find a server variable that contains the correct IP then you can use that in the config file (per the other thread I linked to). Otherwise you would have to contact your host to work this out.
 
Well if you can find a server variable that contains the correct IP then you can use that in the config file (per the other thread I linked to).
Does not appear to be any other variables available.

Otherwise you would have to contact your host to work this out.
Well, that'd be me since the sites in question are all on the same dedicated server and, except for the differences noted above, have been installed & configured the same with fresh XF installations. :coffee:
 
For those having the same issue, found a fix that works for me (your mileage, of course, may vary)...

In your config.php file add the following:
Code:
// FIX FOR SERVER REMOTE_ADDR IP ADDRESS NOT MACTCHING APACHE ENVIRONMENT IP
$_SERVER['REMOTE_ADDR'] = getenv('REMOTE_ADDR');
With the above in place my IP is now showing correctly in Current Visitors and my phantom guest listing is gone.
 
Top Bottom