Why would I be seeing execution timeouts when setting $_SESSION values?
        Posted  
        
            by Kev
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Kev
        
        
        
        Published on 2010-06-08T17:22:35Z
        Indexed on 
            2010/06/08
            17:32 UTC
        
        
        Read the original article
        Hit count: 364
        
I'm seeing the following errors in my PHP error logs:
PHP Fatal error:  Maximum execution time of 60 seconds exceeded in D:\sites\s105504\www\index.php on line 3
PHP Fatal error:  Maximum execution time of 60 seconds exceeded in D:\sites\s105504\www\search.php on line 4  
The lines in question are:
index.php:
01 <?php
02 session_start();
03 ob_start();
04 error_reporting(E_All);
05 $_SESSION['nav'] = "range";  // <-- Error generated here
search.php
01 <?php
02 
03 session_start();
04 $_SESSION['nav'] = "range";
05 $_SESSION['navselected'] = 21; // <-- Error generated here
Would it really take as long as 60+ seconds to assign a $_SESSION[] value?
The platform is:
- Windows 2003 SP2 + IIS6
- FastCGI for Windows 2003 (original RTM build)
- PHP 5.2.6 Non thread-safe build
There aren't any issues with session data files being cleared up on the server as sessions expire. The oldest sess_XXXXXXXXXXXXXX file I'm seeing is around 2 hours old.
There are no disk timeouts evident in the event logs or other such disk health issues that might suggest difficulty creating session data files.
The site is also on a server that isn't under heavy load. The site is busy but not being hammered and is very responsive. It's just that we get these errors, three or four in a row, every three or four hours.
I should also add that I'm not the original developer of this code and that it belongs to a customer who's developer has long since departed.
© Stack Overflow or respective owner