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

后端 未结 4 597
庸人自扰
庸人自扰 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: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:

     
    

    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!

提交回复
热议问题