PDA

View Full Version : PHP server port status



rkcoarch
03-30-2009, 07:56 PM
I host a site through blue host; currently with a shared IP. I am using a simple PHP code to test a remote server port status. I only get open results under port 80 & 443. Ports that are open that I've tested with other port scanners will not show as open from the bluehost server. Is it becuase I have a shared IP and a number of ports are blocked? If I upgrade to a static IP will this work correctly?

Here is a sample of the code:

www.google.com -
<?php
$fp = fsockopen("www.google.com", 80, $errno, $errstr, 1);
if (!$fp) {
echo "no";
} else {
echo "yes";
}
?>

wysiwyg
03-30-2009, 08:45 PM
As you've noted, outbound ports are mostly blocked without a dedicated IP.

Getting one opens them up for you.