Search code examples
phpperformancefastcgi

Script timed out before returning headers: php.fastcgi


After about 90 seconds I see this error in my apache error log. I'm assusming I need to increase a setting in PHP but I'm not sure which one to change.

Is there one setting I can increase to clear this error?


Solution

  • Find in your php.ini file something like this:

    ; Maximum execution time of each script, in seconds
    ; http://php.net/max-execution-time
    ; Note: This directive is hardcoded to 0 for the CLI SAPI
    max_execution_time = 600    
    
    ; Maximum amount of time each script may spend parsing request data. It's a good
    ; idea to limit this time on productions servers in order to eliminate unexpectedly
    ; long running scripts. 
    ; Note: This directive is hardcoded to -1 for the CLI SAPI
    ; Default Value: -1 (Unlimited)
    ; Development Value: 60 (60 seconds)
    ; Production Value: 60 (60 seconds)
    ; http://php.net/max-input-time
    max_input_time = 600
    

    Edit the values, restart apache and you are done.