Test script using the fsockopen() function.

It’s handy for checking whether a connection to a remote server on a specific port is established.

<?php
function get_content(){
$fp = fsockopen ("google.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\nHost: google.com\r\n\r\n");
while (!feof($fp)) { echo fgets ($fp,128);
} fclose ($fp);
} fclose ($fp);
} get_content();

Copy this script into a file named test.php, upload it to the website folder, and open yoursite.com/test.php

In the line $fp = fsockopen ("google.com", 80, $errno, $errstr, 30); replace google.com with the address (URL or IP) of the remote server. And replace 80 with the port number used for the connection.