Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bencarter78@hotmail.com's avatar

Uploading file return response code 413 - Payload too large

Hello

I'm trying to debug why my server is responding with an error code when trying to upload a 2.5MB file to it.

I have set my php.ini file to...

post_max_size = 100M
upload_max_filesize = 64M

My /etc/nginx/nginx.conf file has the following

client_max_body_size 64M;

I have restarted nginx but still get the error.

Any ideas on how to debug this or any likely causes?

Thanks

0 likes
8 replies
Dunsti's avatar

You also need to increase the value for "memory_limit" in your php.ini

Dunsti's avatar

not sure if this is a problem, but all documentations i saw for nginx have a small "m" instead of the "M" you have.

Maybe just also try to set

client_max_body_size 0;

to turn limit off completely

bencarter78@hotmail.com's avatar
Level 14

Such a silly mistake, I was using the php cli .ini file to make the changes which wasn't the correct file to edit.

Thanks for the help everyone!

Please or to participate in this conversation.