This happens because the server limits the upload size
1, nginx server solution
Change the value of nginx.conf and paste the following code into nginx.conf
client_max_body_size 20M;
Copy the code
Optionally set in HTTP {} : client_max_body_size 20m;
Alternatively, set client_max_body_size 20m in server{}.
Optionally set client_max_body_size 20m in location{};
HTTP {} controls the size of all nginx requests
Set to server{} to control the size of all request packets sent by the server
Set to location{} to control the size of request packets that meet the routing rule
Also remember to change the upload limits in php.ini
upload_max_filesize = 20M
Note: if 413 error occurs after the above modification, it may be a domain name problem, I have encountered such situation, record
2. Modify the Apache server
Error 413 sometimes occurs when uploading large software in The Apache environment. The cause of this error is that the Apache configuration file is not properly configured. Go to the apache configuration file directory (conf) and open the conf.d directory parallel to this directory. There’s a php.conf in there
The contents are as follows: # # PHP is an HTML-embedded scripting language which attempts to make it # easy for developers to write dynamically generated webpages. # LoadModule php4_module modules/libphp4.so # # Cause the PHP interpreter handle files with a .php extension. # SetOutputFilter PHP SetInputFilter PHP LimitRequestBody 6550000 # # Add index.php to the list of files that will be served as directory # indexes. # DirectoryIndex index.phpCopy the code
The error occurred in the LimitRequestBody configuration. Change this value to a value larger than the size of your application
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 6550000
Copy the code
Write it to the Apache configuration file.
3, IIS Server (Windows Server 2003 system IIS6)
To stop the IIS Admin Service Service first, and then find the Windows \ system32 \ inesrv \ the metabase XML, open, find the value of the ASPMaxRequestEntityAllowed amended to need, Then restart the IIS Admin Service Service
The Web services extension allows active Server Pages and includes documents on the server side
2. Modify the properties of each site. Home directory – Configuration – Options – Enable parent path
3, make it possible to upload large documents (change the size to the size you want, in bytes)
c:\WINDOWS\system32\inetsrv\MetaBase.xml
! The enterprise edition of windows2003 is on line 592
The default preset value AspMaxRequestEntityAllowed = “204800” or 200 k
Add two zeros to it, i.e., now you can upload a maximum of 20M.
AspMaxRequestEntityAllowed=”20480000″