PHP script not automatically updating when moved to another server

Posted by user32007 on Stack Overflow See other posts from Stack Overflow or by user32007
Published on 2010-03-23T02:33:16Z Indexed on 2010/03/23 8:03 UTC
Read the original article Hit count: 318

Filed under:

A friend built a ranking system on his site and I am trying to host in on mine via WordPress and Go Daddy. It updates for him but when I load it to my site, it works for 6 hours, but as soon as the reload is supposed to occur, it errors and I get a 500 timeout error.

His page is at: jeremynoeljohnson .com/yakezieclub

My page is currently at http://sweatingthebigstuff.com/yakezieclub but when you ?reload=1 it will give the error.

Any idea why this might be happening? Any settings that I might need to change?

Here is the top of the index.php file. I'm not sure which part of any of it is messing up. I literally uploaded the same code as him.

Here's the reload part:

$cachefile = "rankings.html";
$daycachefile = "rankings_history.xml";
$cachetime = (60 * 60) * 6; // every 6 hours, the cache refreshes
$daycachetime = (60 * 60) * 24; 
         // every 24 hours, the history will be written to 
         // - or whenever the page is requested after 24 hours has passed
$writenewdata = false;

if (!empty($_GET['reload']))
{
    if ($_GET['reload']== 1)
    {
        $cachetime = 1;
    }
}

if (!empty($_GET['reloadhistory']))
{
    if ($_GET['reloadhistory'] == 1)
    {
        $daycachetime = 1;
        $cachetime = 1;
    }
}

if (file_exists($daycachefile) && 
                       (time() - $daycachetime < filemtime($daycachefile)))
{
    // Do nothing
}
else
{
    $writenewdata = true;
    $cachetime = 1;
}

// Serve from the cache if it is younger than $cachetime
if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile)))
{
    include($cachefile);
    echo "<!-- Cached ".date('jS F Y H:i', filemtime($cachefile))." -->";
    exit;
}
ob_start(); // start the output buffer

?>

© Stack Overflow or respective owner

PHP script not automatically updating when moved to another server

Posted by user32007 on Super User See other posts from Super User or by user32007
Published on 2010-03-23T02:33:16Z Indexed on 2010/03/23 3:01 UTC
Read the original article Hit count: 318

Filed under:

A friend built a ranking system on his site and I am trying to host in on mine via WordPress and Go Daddy. It updates for him but when I load it to my site, it works for 6 hours, but as soon as the reload is supposed to occur, it errors and I get a 500 timeout error.

His page is at: jeremynoeljohnson .com/yakezieclub

My page is currently at http://sweatingthebigstuff.com/yakezieclub but when you ?reload=1 it will give the error.

Any idea why this might be happening? Any settings that I might need to change?

Here is the top of the index.php file. I'm not sure which part of any of it is messing up. I literally uploaded the same code as him.

Here's the reload part:

$cachefile = "rankings.html";
$daycachefile = "rankings_history.xml";
$cachetime = (60 * 60) * 6; // every 6 hours, the cache refreshes
$daycachetime = (60 * 60) * 24; 
         // every 24 hours, the history will be written to 
         // - or whenever the page is requested after 24 hours has passed
$writenewdata = false;

if (!empty($_GET['reload']))
{
    if ($_GET['reload']== 1)
    {
        $cachetime = 1;
    }
}

if (!empty($_GET['reloadhistory']))
{
    if ($_GET['reloadhistory'] == 1)
    {
        $daycachetime = 1;
        $cachetime = 1;
    }
}

if (file_exists($daycachefile) && 
                       (time() - $daycachetime < filemtime($daycachefile)))
{
    // Do nothing
}
else
{
    $writenewdata = true;
    $cachetime = 1;
}

// Serve from the cache if it is younger than $cachetime
if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile)))
{
    include($cachefile);
    echo "<!-- Cached ".date('jS F Y H:i', filemtime($cachefile))." -->";
    exit;
}
ob_start(); // start the output buffer

?>

© Super User or respective owner

Related posts about php