Can I determine a machine's outward facing IP with PHP without relying on external services?
Posted
by
editor
on Server Fault
See other posts from Server Fault
or by editor
Published on 2011-01-13T17:44:21Z
Indexed on
2011/01/13
17:55 UTC
Read the original article
Hit count: 177
I'm working with an API that requires the machine's external IP. As far as I know, the PHP environment I'm using can only get our internal IP.
The option on the table is using an external service such as whatismyip.com to tell us:
wget -q -O - http://whatismyip.com/automation/n09230945.asp
My concern is what happens if that fails. Is there a bulletproof way of determining a machine's IP without relying on external services?
© Server Fault or respective owner