带有PHP脚本的ERR_CONNECTION_RESET [英] ERR_CONNECTION_RESET with PHP script

查看:220
本文介绍了带有PHP脚本的ERR_CONNECTION_RESET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PHP脚本可以下载和处理一些文件。有时候文件数量非常大,所以需要一些时间。

I have a PHP scripts that downloads and process some files. Sometimes the number of files is very large, so it takes some time.

但是当有很多文件需要处理时,连接会因为ERR_CONNECTION_RESET错误而中断(Chrome)。

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

我有一个共享的hostind。任何人都知道如何解决这个问题?

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.

你做错了在这里。由于这种协议限制(TCP,HTTP),您无法在HTTP请求中执行大量计算。

"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).

您的请求必须产生某种背景任务将不时通知其进度。只使用PHP的共享主机,这可能不容易完成,所以你可能想找到另一种方式来做你的繁重的计算。

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.

这篇关于带有PHP脚本的ERR_CONNECTION_RESET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆