I was using $_SERVER['LOCAL_ADDR'] to determine the IP of the webserver. This works fine if run from an 'external browser' but when the browser is run from the web server it gives me 127.0.0.1...
I have used phinfo to look at all the server vars, they are all set to 127.0.0.1, I was hoping maybe there was a constant set by php or some other method.
this is win2k/IIS/php4.3.1
Does anyone have an idea how I can get the actual IP when I run from the server.
Thanks.
How to retrieve web server ip
Moderator: General Moderators
yeah, it looks like that's what I will have to do. The issue is that we have multiple web servers behind a load-balancer. Up to this point I have been able to have exactly the same code on all servers, now I need to have something special on each server.McGruff wrote:Any website has to have a constant IP: once you know what it is just create a user-defined constant in a config.php file or somewhere?