PHP在不延长set_time_limit的情况下长时间执行Web服务

I need to write a script that reads a big .csv and generates a file for each row.

Since on this server I can't modify timeout with set_time_limit, in my script that is manually executed in browser via http I get 10 row, execute my code for each, reach the end and auto reload for next 10 row, so on till I reach the end.

Now I need to convert this script into a web service, but I don't know how to avoid that the scripts timeout.

set_time_limit(900) // does not work

From reading here it seems it has a restriction.

This function has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the php.ini.

Do you have safe mode enabled? If so, it seems you may have to disable it. You can also see other values that do the same/similar actions here, though they also require safe mode to be disabled.