不管正确设置如何,在上传大文件时重置PHP连接 [英] PHP Connection Reset on Large File Upload Regardless Correct Setting

查看:103
本文介绍了不管正确设置如何,在上传大文件时重置PHP连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到一个非常普遍的问题,似乎所有可用的解决方案都无法正常工作.

I am having a very common problem which it seems that all the available solutions found are not working.

我们有一台LAMP服务器正在接收大量流量.使用此服务器,我们执行常规文件提交上载.在上传小文件时,它可以完美运行.在大约4-5MB的文件上,此提交上传间歇性地失败了(有时可以,但是很多次失败).

We have a LAMP server which is receiving high amount of traffic. Using this server, we perform a regular file submission upload. On small file uploads, it works perfectly. On files of around 4-5MB, this submission upload failed intermittently (sometimes it works but many times it failed).

我们在PHP上具有以下配置:

We have the following configuration on our PHP:

max_input_time: 600
max_execution_time: 600
max_upload_size: 10M
post_max_size: 10M

Apache设置:

Timeout: 600
Keep-Alive Timeout: 15
Keep-Alive: On
Per Child: 1000
Max Conn: 100

因此,我想知道是否有人可以帮助我.我们已经在线找到了问题和解决方案,但在我们的案例中没有一个起作用.

Thus, I wonder if anyone can help me with this. We have found the issues and solutions online but none of them work in our case.

非常感谢.任何输入/反馈都非常感谢!

Thank you so much. Any input / feedback is much appreciated!

推荐答案

连接可能在多个地方终止:

The connection coud be terminating at several places:

  1. Apache
  2. php.ini内部的帖子大小限制
  3. php.ini内部的内存限制
  4. 在php.ini中输入时间限制
  5. php.ini或 set_time_limit()
  1. Apache
  2. Post size limit inside of php.ini
  3. Memory limit inside of php.ini
  4. Input time limit inside of php.ini
  5. Execution time limit inside of php.ini or set_time_limit()

我会增加所有这些,然后看它是否仍然存在.但是您必须重新启动apache才能使php.ini内部的更改生效.

I would increase all of these, and see if it still persists. But you will have to bounce apache for the changes inside of php.ini to take affect.

这些也受最终用户的连接速度的影响,如果某些用户失败,那是因为他们的连接速度比其他人慢,并且他们与服务器的连接正在终止.

These are also affected by what kind of connection speed the end user has, if it is failing for certain users, it's because their connection is slower than others, and their connection with the server is terminating.

这篇关于不管正确设置如何,在上传大文件时重置PHP连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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