Hi,
I have web hosting account on hostgator. I need port 25 enable.
So I login to server using SSH to check port and run php script but script says port 25 not enable and hostgator support team on chat says port 25 working fine.
I want to know how to check port 25 using SSH access or php script.
I am getting gateway timeout 504 error on below script.
$host = 'stackoverflow.com';
$ports = array(21, 25, 80, 81, 110, 443, 3306);
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";
}
}
Any idea?
Best Regards,