|
Posted by ruibalp on 10/15/06 06:44
$_SERVER['SERVER_ADDR'] // should work for php/apache
you could try seeing if there's anything specific to your webserver by
print_r($globals)
Are you running a CLI script?
There might be something in pear, I'd check the Net or Socket related
packages
you could also see if there's something in pear...
If the socket_* methods aren't blocked, you could attempt to make an
outgoing socket connection to an HTTP port or something you _know_ you
can connect to (i.e. 'http://google.com:80'), and then read the local
IP address of outgoing socket. for example:
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($sock, '66.102.7.147', 80);
socket_getsockname($sock,$hn);
print($hn);
socket_close($sock);
hope it helps
tg
On Oct 14, 1:20 pm, at(nospam) <"lasse(at(nospam))the87boy.dk"> wrote:
> Hey
>
> I'm looking for a script, which finds the ip address of the server, it's
> running on
> It should be compatible with both Linux and Windows
Navigation:
[Reply to this message]
|