I want to check if the systems is Down
<?php
ini_set("default_socket_timeout","05");
set_time_limit(5);
$f=fopen("https://stackoverflow.com/questions/ask","r");
$r=fread($f,1000);
fclose($f);
if(strlen($r)>1) {
echo("<span class='online'>Up</span>");
}
else {
echo("<span class='offline'>Down</span>");
}
?> The code above only show if the url is available I want also to show Down if the system is provide this error Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)' in
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire