Sunday, October 2, 2011

Your PHP scripts get timeout error?

If you have php scripts that has to be executed longer than normally, probably because it has complex calculation/tasks to be executed, then you may end up with script timeout error. By default, each php script is given 60 seconds maximum period to complete. If you need more time, then you need to edit your php.ini configuration file.

Open your php.ini file, find and change these following section:

max_execution_time = 600    
; Maximum execution time of each script, in seconds

max_input_time = 600 
; Maximum amount of time each script may spend parsing request data in apache

Restart your Apache webserver to apply the new configurations.
It is recommended that you first inspect your scripts to find out why it takes longer to executed, probably there are some bugs or inefficient use of programming logic.

No comments: