Here's another way to PING a host using PHP. It's more clumsy but more compatible.
<?
$host='CHANGETHISTOYOURHOST';
$strPing= ping $host;
$posstring = strpos($strPing, "Please", 1);
if ($posstring == 0)
{ echo "Server online!"; }
else
{ echo "Server offline!"; }
?>
This will return "Server online!" if the server is online and "Server offline!" if the server is offline