简体   繁体   中英

413: Request entity too large apache php mysql

I have been getting this 413 response when trying to upload an ~20MB zip file with a home grown (but not by me) document library resource developed in PHP running on an Apache server with a MySQL database connected. Normally the max file size is limited to 5.2MB in a local PHP variable. So the first thing I did was to increase this value and try to upload the file. That's the first time I encountered this error.

I tried everything mentioned here: Request Entity Too Large

And even changed the mod_security config settings mentioned in the bottom of that post. Even with all the limits I found raised far above what I should need -- up to ~120MB, I still get this error.

So after posting this, I found another mod_security limit that needed to be raised appropriately.

SecRequestBodyLimit was too low (131072).

This is probably a corner case, but hope it helps someone else.

This worked fine for me maybe this helps you to upload larger files:
Change these values in php.ini:

upload_max_filesize 3000M
post_max_size 3000M
max_execution_time 3600
max_input_time 3600

Do you increase LimitRequestBody in your apache config? Link to LimitRequestBody in Apache Documentation

None of the listed fixed my problem. They were all set much higher than needed. I was posting 100k-500k textarea fields. What did fix it for me was adding the following to the <form> tag.

enctype="multipart/form-data"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM