Error 413, Request Entity Too Large

I ran into a problem with a Drupal site today. Any file upload over about 500k was resulting in a "Document Contains No Data" error on Firefox, and an Error 413 "Request Entity Too Large" error on Internet Explorer. Because very small file uploads were working fine, I assumed the problem was file size related.

First I edited /etc/php.ini.


post_max_size = 25M
upload_max_filesize = 20M

Those values showed successfully in phpinfo() calls, but I was still receiving the Request Entity Too Large error. I read somewhere that the apache LimitRequestBody directive may be the culprit. As it turns out, my RedHat Linux distribution sets up a low LimitRequestBody by default. It is increased by editing the /etc/httpd/conf.d/php.conf file.

SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 26214400

The LimitRequestBody directive wants a value in bytes, so you'll need to calculate (70 Megabytes = 70 * 1024 * 1024).

Reply

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.

More information about formatting options