How to prevent timeout when running a time consuming PHP

789 views Asked by At

I am using PHP that gets so many data from several sites and write those data to the server which make files greater than 500 MB, but the process fails in between giving a 500 INTERNAL ERROR, how to adjust the timeout time of the php so that the process runs till it is completed.

2

There are 2 answers

11
prakhar19 On BEST ANSWER

If you want to increase the maximum execution time for your scripts, then just change the value of the following setting in your php.ini file-

max_execution_time = 60

If you want more memory for your scripts, then change this-

memory_limit = 128M

One more thing, if you keep on processing the input(GET or POST), then you need to increase this as well-

max_input_time = 60
0
Syerad On

you have to set some settings in the php.ini to solve this problem. There are some options which could be the problem. Could you pls post your php.ini config? Which kind of webserver do you use?Apache?