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

6ber6ou's avatar

413 Request Entity Too Large

Hi all. I use Forge, when I upload files I have this error :

413 Request Entity Too Large
nginx/1.8.0

I added to /etc/nginx/nginx.conf in the http section :

client_max_body_size 100M; 

I restarted ngnix :

/etc/init.d/nginx restart

But when I run :

grep -E "upload_max_filesize|memory_limit|post_max_size" /etc/php5/fpm/php.ini

I have this :

memory_limit = 512M
post_max_size = 8M
upload_max_filesize = 2M

What's going wrong ?

0 likes
3 replies
joedawson's avatar
Level 18

Look at the "Meta" tab under your server in the Forge control panel, you can increase the Max File Upload Size there.

4 likes
bashy's avatar

Changing nginx settings (client_max_body_size) doesn't change what php allows. I've not used Forge but you can use this to change it directly in the php.ini file.

sudo sed -i "s/\post_max_size = .*/post_max_size = 125M/" /etc/php5/fpm/php.ini
sudo sed -i "s/\upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php5/fpm/php.ini

Afterwards

sudo service php-fpm reload
laramark's avatar

@JOEDAWSON - Please note that since last year, this option has changed to the "PHP" tab on your server page.

1 like

Please or to participate in this conversation.