Atef95's avatar

413 Payload Too Large problem

Hey guys

I'm struggling for hours to debug the error 413 Payload Too Large in my server but couldn't figure out a solution

That occured during a file upload

My server is Apache/2.4.18 (Ubuntu)

I ran

php -i | grep 'php.ini'

 ->  it showed  /etc/php/7.2/cli/php.ini

then I set both post_max_size and upload_max_filesize to 10000

I reloaded but no way...

I also tried

<Directory "/var/www/html/myproject/public">
    LimitRequestBody 102400 
</Directory>

also no way...

is there any other thing I can try? =(

0 likes
4 replies
BryanK's avatar

How large is the file you're uploading? Is it larger than 9.76MB?

Do you have a reverse proxy for your front end?

1 like
virtualmayur's avatar

Hello @bryank, I am trying to post a file in base64 in the request and getting the same error in laravel 5.4 in PHP 7.4, I have already changed Nginx conf and php.ini but still getting the same error. Can you please help me with that? I am using a reverse proxy, frontend deployed on the Nginx server and the backend APIs are in the apache server.

client_max_body_size 100M;

in php.ini

upload_max_filesize 100M;
post_max_size 100M;
memory_limit 120M;
lucasmartins's avatar

Hi @atef95 , were you able to solve this problem?

I have this problem when trying to send a very large payload (with a large base64) via API.

I also use Apache. If anyone knows how I can solve it, I would be very grateful.

Please or to participate in this conversation.