Files
Testing/check-sockets.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

31 lines
635 B
PHP

<?php
$host = 'localhost';
//$ports = array(8080, 8880, 2052, 8888);
$ports = array(8443);
foreach ($ports as $port)
{
$connection = @fsockopen($host, $port);
if (is_resource($connection))
{
echo '<h2>' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</h2>' . "\n";
fclose($connection);
}
else
{
echo '<h2>' . $host . ':' . $port . ' is not responding.</h2>' . "\n";
$fail = yes;
}
}
if ( $fail == "yes" ) {
print 'please check server motd - issues found cpanel.bateworld.com';
} else {
echo 'OK ! No failures found!';
}