Skip to content

Instantly share code, notes, and snippets.

@bhowe
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save bhowe/7e7acf9453706cd7c0a7 to your computer and use it in GitHub Desktop.

Select an option

Save bhowe/7e7acf9453706cd7c0a7 to your computer and use it in GitHub Desktop.
Simple Case to check if an SSL port is active
<?php
/*
Blake B Howe
http://blakebhowe.com
*/
function checkConnection()
{
$conn = @fsockopen("www.abc.com", 443, $errno, $errstr, 30);
if ($conn)
{
$status = "Connection is OK";
fclose($conn);
}
else
{
$status = "NO Connection<br/>\n";
$status .= "$errstr ($errno)";
}
return $status;
}
echo checkConnection();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment