Re: Howto detect the hostname of the server?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

On Saturday 26 Nov 2011 at 00:14 Andreas wrote:

> how could I identify the server the script runs on?

[snip]
 
> I looked into phpinfo() but haven't found anything helpful, yet.
> Have I overlooked something or is there another way to identify the server?

Wouldn't the server IP address in $_SERVER['SERVER_ADDR'] or the hostname in 
$_SERVER['SERVER_NAME'] do the trick? That's what I use. The second one is 
handy for differentiating between sites when using Apache name-based virtual 
hosts on the same IP.

Full list here:

http://uk.php.net/manual/en/reserved.variables.server.php

Cheers,

Mark

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux