Troubleshooting

From Sohowiki
Revision as of 20:35, 20 April 2006 by Mike Morrison (Talk | contribs)
(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

This is place for all miscellaneous tips and solutions gleamed from various customer inquiries and support incidents.


How do I find out my server hostname and IP Address?

Create a .php script that looks like this, upload it to your site, and pull it up in your browser.

<?

# Get IP by global var or reverse dns lookup (if global var not set)
if ( $_SERVER['SERVER_ADDR'] != "" ) {
   $my_ip_address = $_SERVER['SERVER_ADDR'];
} elseif ( gethostbyname(php_uname(n)) != "" ) {
   $my_ip_address = gethostbyname(php_uname(n));
}

echo "My hostname: [".php_uname(n)."]<br>";
echo "My IP address: [".$my_ip_address."]";

?>
Personal tools