413 Request Entity Too Large - File Upload Issue

后端 未结 10 1270
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 10:28

I am trying to upload 30MB file on my server and its not working.

  1. When I upload 30MB file, the page loads \"Page Not Found\"

  2. <
相关标签:
10条回答
  • 2020-12-04 11:20

    Assuming that you made the necessary changes in your php.ini files:

    You can resolve the issue by adding the following line in your nginx.conf file found in the following path:

    /etc/nginx/nginx.conf
    

    then edit the file using vim text editor as follows:

    vi /etc/nginx/nginx.conf
    

    and add client_max_body_size with a large enough value, for example:

    client_max_body_size 20MB;
    

    After that make sure you save using :xi or :wq

    And then restart your nginx.

    That's it.

    Worked for me, hope this helps.

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

    Open file/etc/nginx/nginx.conf Add or change client_max_body_size 0;

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

    Source: http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/

    Edit the conf file of nginx:

    nano /etc/nginx/nginx.conf
    

    Add a line in the http section:

    http {
        client_max_body_size 100M;
    }
    

    Doen't use MB it will not work, only the M!

    Also do not forget to restart nginx

    systemctl restart nginx
    
    0 讨论(0)
  • 2020-12-04 11:27

    Use:

    php -i
    

    command or add:

    phpinfo();
    

    to get the location of configuration file.

    Update these variables according to your need and server

    max_input_time = 24000
    max_execution_time = 24000
    upload_max_filesize = 12000M
    post_max_size = 24000M
    memory_limit = 12000M
    

    On Linux you will need to restart nginx / apache and phpfpm service so the new ini settings are loaded. On xampp, ammps you can restart these from control panel that comes with such applications.

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