Request Entity Too Large PHP

Request Entity Too Large PHP

post_max_size and upload_max_filesize are PHP.ini settings. You can set them either directly in PHP.ini or via ini_set. I don't know if this can be set with some Cake-internal tools as well.

However, the error could also be caused by a set limit of the RequestBodyLength in Apache (assuming you are running under Apache).

413 Request Entity Too Large, using CodeIgniter: phpinfo() indicates proper max size

It looks like the error is coming not from PHP but from a web server.

If you're using nginx, you could up the max allowed post size with client_max_body_size directive

server {
...
client_max_body_size 128m
...
}

If you're using Apache, then there are a couple of options to check for in its config file (httpd.conf).

LimitRequestBody 131072000

If mod_security module is used in Apache, update limit for it as well:

SecRequestBodyLimit 131072000

Don't forget to restart the server.

PHP 413 (Request Entity Too Large)

As hakre pointed out, beyond the settings in PHP you'll often receive 413 errors occur when the size of the request payload is beyond what the web server configuration allows. These directives vary by server, but here are some common ones (if you're using a hosted platform, you'll likely need to contact your host's support team):

  • Nginx: Look at the client_max_body_size directive for nginx.conf (http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size)

  • Apache: The directive LimitRequestBody can be used in httpd.conf or in directory-level .htaccess files (http://httpd.apache.org/docs/2.4/mod/core.html#limitrequestbody)

  • IIS: Look into maxAllowedContentLength (part of requestFiltering > requestLimits), or UploadReadAheadSize in IIS6 (IIS solutions are very version-dependent, so I'd recommend researching a bit).

If you're serving requests over HTTP and HTTPS, make sure that the relevant configuration applies to both.

While less common (more so in corporate networks), this can also have to do with other proxies or security devices that the request is being passed through, since each of those may have different limits affecting the handling of the request.

When in doubt, check the logs: first, make sure that the request is getting to your server (in the access logs), if it is, check the response code, and then also check the error logs.

Hope that helps!

413 Request Entity Too Large nginx server in laravel homestead for windows

sudo nano /etc/nginx/nginx.conf

Then add a line in the http section

http {
client_max_body_size 100M;
}

don't use MB only M.

sudo systemctl restart nginx

then for php location

sudo gedit /etc/php5/fpm/php.ini

for nowdays maximum use php 7.0 or higher

sudo nano /etc/php/7.2/fpm/php.ini     //7.3,7.2 or 7.1 which php you use

check those increasing by your desire .

memory_limit = 128M 
post_max_size = 20M
upload_max_filesize = 10M

restart php-fpm

sudo service php-fpm restart 

SOAP Client Request Entity Too Large

The problem in my case was the endpoint.
I was uploading to:

'https://wsbeta.fedex.com:443/web-services/'

I needed to upload to:

'https://wsbeta.fedex.com:443/web-services/uploaddocument'

It seems the wrong endpoint will still accept and process the request, but the correct endpoint accepts larger files.

File upload limit in Nginx & (The server returned a 413 Content Too Large )

You also have to edit your php.ini which is currently loaded. You can find this from <?php phpinfo(); then edit the following.

memory_limit = 64M
upload_max_filesize = 100M
post_max_size = 100M


Related Topics



Leave a reply



Submit