Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
553 views
in Technique[技术] by (71.8m points)

php - How to avoid Request Entity Too Large 413 error

How to avoid this 413 error ?

Request Entity Too Large

The requested resource /serverpath/reports.php does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.

Apache Server at demo3.website_name Port 80

So, could any one please help to set php.ini and how to set htaccess to allow overwrite status

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

How to fix it in NGINX? client_max_body_size

To fix this, you need to increase the value of the client_max_body_size directive. This directive defines the maximum amount of data Nginx will accept in an HTTP request. By default this value is set to 1 megabyte, meaning if you attempt to upload a file larger than 1 megabyte you'll be getting an Error 413: Request entity too large page. You can insert this directive at three levels:

  • In the http block: this will set the directive value for all server and locations in your configurationn

  • In the server block: this will set the directive value for all locations of one particular server

  • In the location block: this will set the directive value for one specific location in a particular server

In this example I'm going to insert it in my http block and set it to 500 megabytes:

http {

    client_max_body_size 500M; # allows file uploads up to 500 megabytes
    [...]
}

source: http://cnedelcu.blogspot.com.ar/2013/09/nginx-error-413-request-entity-too-large.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...