PHP Connection Reset on Large File Upload Regardless Correct Setting

霸气de小男生 提交于 2020-01-21 01:41:10

问题


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

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

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 setting:

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!


回答1:


The connection coud be terminating at several places:

  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()

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.



来源:https://stackoverflow.com/questions/7574260/php-connection-reset-on-large-file-upload-regardless-correct-setting

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!