Error 500 after 10 minutes


  • | 402 points

    Hi,

    I get error 500 after 10 minutes while execute the following sample code (Load the PHP page from browser):

    <?php
    ini_set('max_execution_time', 0);
    set_time_limit(0);
    while($i = 1)
    {
    	sleep(10);
    }
    ?>
    

    I use Laragon 2 and FcgidIOTimeout is set to 36000.

    Thanks.


  • administrators
    | 61689 points

    It seems that you are in an infinite loop.


  • | 402 points

    Yes, This is an example to simulation for a program that need more than 10 minutes to take finish.


  • | 402 points

    Also when a php request that use SESSION is active, new request that use SESSION too can not excute until the old one get done.

    For example use this code to create a loop.php:

    <?php
    session_start();
    
    echo 'Welcome to page #1';
    
    $_SESSION['favcolor'] = 'green';
    
    while ($i = 1)
    {
        sleep(5);
    }
    
    ?>
    

    And create another file with this code as new.php.

    <?php
    session_start();
    
    echo 'Welcome to page #2';
    
    $_SESSION['test'] = 'red';
    
    ?>
    

    Now open http://laragon.dev/loop.php and http://laragon.dev/new.php.


  • administrators
    | 61689 points

    @alitalaghat: Unfortunately, this is how fastcgi works on Windows. If we do it the right way, fastcgi is very fast and use low memory. I had been testing it with many Frameworks, CMS, Magento,...and have seen no issue but benefits.

    The way you test is not wrong, some PHP devs may code something like this. So I decide to support both TS and NTS in Laragon version 2.0.2
    Thread Safe (TS) for compatibility and Non Thread Safe (NTS) for performance.

    Many thanks for your examples.


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.