I have a PHP scripts that downloads and process some files. Sometimes the number of files is very large, so it takes some time.
But when there are a lot of files to process, the connection interrupts with a "ERR_CONNECTION_RESET" error (Chrome).
Here's my configuration:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 0
max_input_time = -1
memory_limit = 512M
I have a shared hostind. Anyone knows how to fix this?
If there are too many files to process, you'll eventually stumble upon this issue whatever your configuration. Even if you disable all timeouts server-side, the client itself has its own safety features and will eventually timeout after a certain time — something you can't control.
“You are doing it wrong” here. You cannot do any heavy computation in a HTTP request because of this kind of protocol limitations (TCP, HTTP).
Your request has to spawn some kind of background task that will notify of its progress from time to time. Using a shared hosting with PHP only, this might not be easy to accomplish, so you may want to find another way of doing your heavy computation.