Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2009
    Posts
    135
    Thanks
    83
    Thanked 0 Times in 0 Posts

    Server Stops Loading PHP After 5 Minutes??? Page Stops Loading, PHP Continues

    I recently had some work done on my server and since the alterations something has changed although I am not too sure what setting it is.

    Before the change I can load a PHP file that loops, E.g.
    PHP Code:
    <?php
    $i
    =0;
    while (
    $i<10000000000){
        
    sleep(1);
        echo 
    $i;
        
    $i++;
        }
    ?>
    So this is pretty much an endless loop, it would take 10000000000 seconds to complete.

    What happens now with a script like this is after 5 minutes the browser stops loading BUT the PHP continues to run. I can tell because I can see the MySQL queries continuing to update.

    The issue is not with my browser as on another server the same script works fine, it is just a server option somewhere has changed to timeout user connections, any ideas which one it may be?

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    There are timeout settings in Apache for how long it will keep a connection open before it times out. Perhaps someone lowered the time?

    Though I feel compelled to mention that if you have a script that is taking 5+ minutes to run perhaps it should be ran via a shell script instead of through the browser. But that depends on what it is doing.
    OracleGuy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •