2.8.1.2. Outgoing port check script

In case of the error "is not responding", check the results of antivirus scan.

To check the availability of outgoing ports, you can run this script:

<?php

$host = 'portquiz.net';
$ports = array(80, 443, 465, 587);

foreach ($ports as $port) {
    $connection = @fsockopen($host, $port);
    if (is_resource($connection)) {
        $result = ' (' . getservbyport($port, 'tcp') . ') is open';
        fclose($connection);
    } else {
        $result = ' is not responding';
    }
    print($host . ': ' . $port . $result . '<br>');
}
  • In line 3, specify the address of the host to which connection attempts will be made. You can use the public portquiz.net or specify the address of a specific host to be accessed.
  • In line 4, the numbers of ports to be checked in parentheses separated by commas.
Content