I've messed with the hosts file in XP and have been reading through the documentation on Apache's site and haven't found anything that I could use to force Apache to use my machine's local IP (192.168.x.x) as the ServerName in httpd.conf. My local IP changes as I have to take my system with me on occasion so from my understanding if I want to echo PHP's
$_SERVER['SERVER_ADDR'] as my local IP instead of 127.0.0.1 I will have to change Apache's ServerName to use my computer's local network's IP. From everything that I've tried it seems I somehow have to opt-in to doing this. I also can not rely on manually setting any host file on any machine except my own though if I have to do so it should only be once in the desired scenario.
So ultimately how do I force Apache to set PHP's $_SERVER['SERVER_ADDR'] IP to my dynamic local network IP instead of 127.0.0.1? I am not using any virtual hosts if that is an important factor to consider.
- John