PHP throwing "Operation timed out"

Discussion in 'Site & Server Administration' started by joujoba, Sep 10, 2012.

  1. #1
    Hello,

    I am trying to run this script on my dedicated server:
    <?php
    
    // current time
    echo date('h:i:s') . "\n";
    
    // sleep for 65 seconds
    sleep(65);
    
    // wake up !
    echo date('h:i:s') . "\n";
    
    ?>
    PHP:
    However every time after 60s the browser throw this error:
    I have edited my php.ini and set the max_execution_time to 3600 and the max_input_time to 3600
    I also even changed the apache configuration TimeOut to 3600
    I have restarted apache and I'm still getting the same error.
    please help

    thank you
     
    joujoba, Sep 10, 2012 IP
  2. slackersecurity

    slackersecurity Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    Hmm try this.
    
    <?php
    set_time_limit(100);
    
    // current time
    echo date('h:i:s') . "\n";
    
    // sleep for 65 seconds
    sleep(65);
    
    // wake up !
    echo date('h:i:s') . "\n";
    
    ?>
    PHP:
     
    slackersecurity, Sep 10, 2012 IP
  3. joujoba

    joujoba Peon

    Messages:
    100
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It timed out still :/

    here's the error firefox throwed at me:
    if sleep is set to 30 or more seconds it throw this error, if its set to 29 it works fine :/
     
    joujoba, Sep 11, 2012 IP
  4. joujoba

    joujoba Peon

    Messages:
    100
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    bump please
     
    joujoba, Sep 17, 2012 IP
  5. RonBrown

    RonBrown Well-Known Member

    Messages:
    934
    Likes Received:
    55
    Best Answers:
    4
    Trophy Points:
    105
    #5
    Doesn't sound like a server issue, more like a browser issue i.e. your browser is trying to download the page, the server stops responding for X seconds (during sleep), and the browser thinks the server has stopped responding.

    You need to change the timeout period in your browser so it waits longer for the server to start responing again - no idea how, but that's what you need to do.

    65 seconds is an eternity to computers, why would you even want your server to stop responding for that length of time?
     
    RonBrown, Sep 19, 2012 IP
  6. cesurasean

    cesurasean Active Member

    Messages:
    269
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #6
    Do you still require help with this? Chat me on skype - cesurasean , and we can discuss the project more. Thank you.
     
    cesurasean, Sep 26, 2012 IP