View Single Post
Old July 2nd, 2008, 8:20 AM   #1 (permalink)
MarkRH
Race Surpass
Super #1
 
MarkRH's Avatar
 
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,222 posts
Gave thanks: 18
Thanked 86 times
SH102, PHP having name resolving issues

Ticket: BZG-526427

The effect can be seen here: http://www.markheadrick.com/php/server_status.php

Everything uses the same code:
PHP Code:
while ($count $ports)
{
    if (
$ip[$count] == '')
    {
        
$ip[$count] = 'localhost';
    }
    
$port_starttime getmicrotime();
    
$fp = @fsockopen($ip[$count], $port[$count], $errno$errstr$timeout);
    if (!
$fp)
    {
        echo 
"<tr>\n  <td>{$service[$count]}</td>\n  <td class=\"offline\">Offline</td>\n<td>".number_format((getmicrotime() - $port_starttime), 4)." seconds</td></tr>\n";
    }
    else
    {
        echo 
"<tr>\n  <td>{$service[$count]}</td>\n  <td class=\"online\">Online</td>\n<td>".number_format((getmicrotime() - $port_starttime), 4)." seconds</td></tr>\n";
        
fclose($fp);
    }
    
$count++;

I am getting up to a 10 second delay when using cURL or fsockopen() to connect to a website outside the server or one of my subdomains on the server. For example, my main page at Mark R Headrick's Web Page uses cURL to connect to gallery.markheadrick.com and it is generally timing out, taking over 5 seconds.

I think what's throwing support a loop at the moment is that from a SSH prompt you can ping google.com or gallery.markheadrick.com and get the name to resolve immediately... but not parts of PHP it seems. Was working fine up until a few hours ago.
MarkRH is offline   Reply With Quote