make script execution to unlimited

php, xampp

Solution

You'll have to set it to zero. Zero means the script can run forever. Add the following at the start of your script:

ini_set('max_execution_time', 0);

Refer to the PHP documentation of `max_execution_time`

Note that:

set_time_limit(0);

will have the same effect.

Problem

I need to run a script into localhost (xampp) which will generate 14400 records and adds them into database, I have set the `max_execution_time = 50000000000`, I dont know if I can make it unlimited by setting it to 0 or -1. But I tried this script before with this max_execution_time to 50000000000 and yet it stoped at certain point, I dont know what else could limit the execution time, I have been running this a lot of times and I am tired of waiting and failing again, what should I change before I run this script again and this time to finish the job?

Original source