net::ERR_CONNECTION_RESET when large file takes longer than a minute

后端 未结 4 586
庸人自扰
庸人自扰 2020-12-11 15:51

I have a multipart file upload in a form with a php backend. I\'ve set max_execution_time and max_input_time in php.ini to 180 and confirmed on the

相关标签:
4条回答
  • 2020-12-11 16:02

    In my opinion it maybe relative to one of them:

    About apache config (/etc/httpd2/conf ou /etc/apache2/conf):

    Timeout 300
    max_execution_time = 300
    

    About php config ('php.ini'):

    upload_max_filesize = 2000M
    post_max_size = 2000M
    max_input_time = 300
    memory_limit = 3092M
    max_execution_time = 300
    

    About PostgreSQL config (execute this request):

    SET statement_timeout TO 0;
    

    About proxy, (or apache mod_proxy), it maybe also be due to proxy timeout configuration

    0 讨论(0)
  • 2020-12-11 16:03

    I had the same problem. I used the resumable file upload method where if the internet is disconnected and reconnects back then the upload resumes from the same progress.

    Check out the library https://packagist.org/packages/pion/laravel-chunk-upload

    1. Installation

    composer require pion/laravel-chunk-upload

    1. Add service provider

    \Pion\Laravel\ChunkUpload\Providers\ChunkUploadServiceProvider::class

    1. Publish the config

    php artisan vendor:publish --provider="Pion\Laravel\ChunkUpload\Providers\ChunkUploadServiceProvider"

    0 讨论(0)
  • 2020-12-11 16:04

    I went through a similar problem, in my case it was related to mod_reqtimeout by adding:

    RequestReadTimeout header=20-40, MinRate=500 body=20, MinRate=500
    

    to httpd.conf did the trick! You can check the documentation here.

    Hope it helps!

    0 讨论(0)
  • 2020-12-11 16:09

    ERR_CONNECTION_RESET usually means that the connection to the server has ceased without sending any response to the client. 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. It could be some sort of Segmentation Fault or something like that. If you have access to error logs, check them. Otherwise, you might get support from your hosting company.

    I would recommend you to try some of these things:

    1) Try cleaning the browser's cache. If you have already visited the page, it is possible for the cache to contain information that doesn’t match the current version of the website and so blocks the connection setup, making the ERR_CONNECTION_RESET message appear.

    2) Add the following to your settings:

    memory_limit = 1024M
    
    max_input_vars = 2000
    
    upload_max_filesize = 300M
    
    post_max_size = 300M
    
    max_execution_time = 990
    

    3) Try setting the following input in your form:

    <input type="hidden" name="MAX_FILE_SIZE" value="300000000" /> 
    

    4) In your processing script, increase the session timeout:

    set_time_limit(200); 
    

    5) You might need to tune up the SSL buffer size in your apache config file.

    SSLRenegBufferSize 10486000
    

    The name and location of the conf file is different depending on distributions.

    In Debian you find the conf file in /etc/apache2/sites-available/default-ssl.conf

    6) A few times it is mod_security module which prevents post of large data approximately 171 KB. Try adding/modifying the following in mod_security.conf

    SecRequestBodyNoFilesLimit 10486000
    SecRequestBodyInMemoryLimit 10486000
    

    I hope something might work out!

    0 讨论(0)
提交回复
热议问题