Closed p-rez closed 4 years ago
I use the following as I wrote in 2001; there may be better ways to do this in 2019, but then again this still works to this very date:
global $SYS_ADMIN, $TIMEOUT;
$fp = fsockopen( $hostname, $port, &$errno, &$errstr, $TIMEOUT );
if( $fp ) {
echo "Port open";
} else {
echo "Port closed";
}
for checking if the service is open; however when I run nginx as a reverse proxy in front of the CWP there is hardly ever any issues.
That's exactly what i was looking for, it works as expected thanks @TyrfingMjolnir
Hi is there a way to check if the server is online before doing a query? Sometimes the server is down and the request just hangs up, i want to show an error page in case the FM server is down