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 proc
ERR_CONNECTION_RESET usually means that the connection to the server has died without any responses to the client – not even some kind of HTTP 5xx error. This means that the entire PHP process has died without being able to shut down properly.
This is usually not caused by something like an exceeded memory_limit, because that's something PHP would handle gracefully. This must be some sort of Segmentation Fault or similar. If you have access to error logs, check them. Otherwise, you might get support from your hosting company.