The ubuntu server 7.10 runs behind a router with a port mapping using port 25011. I can access the website hosted on the server from outside the router. I have another hosting space where I place the main page of the website. Visitors go to the main page first, where php script fsockopen determines the first server status and redirects accordingly.
I have tested the pingDomain function (below), and it works fine to reach sites like google.com or yahoo.com
But, I cannot reach the first server. Forget to mention that I test port check with http://www.canyouseeme.org/, it says port 25011 is reachable.
I dont know what is the problem. Is it the problem of ubuntu server configuration or PHP?
// Function to check response time
$file = fsockopen ($domain, 25011, $errno, $errstr, 8);
$status = 0;
if (!$file) $status = -1; // Site is down
$status = 1;
Please help. Thanks in advance