Check whether outbound port on server is open

982 views Asked by At

I am trying to see whether my port 2195 (apples port) is open for outbound executions. I know that it is closed for inbound. I want to be able to check using php so I wrote this code:

$fp = fsockopen("example.co.uk", 2195, $errno, $errstr, 30);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    fclose($fp);
}

Which returns the error:

Warning: fsockopen(): unable to connect to example.co.uk:2195 (Connection refused) in /home3/.../public_html/.../example.php on line 13 Connection refused (111)

But as I said I think this is due to the inbound port being closed.

So is there another way to test just the outbound?

0

There are 0 answers