0

I've increased params values in php.ini:

upload_max_filesize = 10M
post_max_size = 12M

And php --ini command in console shows me:

post_max_size => 12M => 12M
upload_max_filesize => 10M => 10M

But anyways, when I'm trying to send file > 1mb I get err. In nginx logs I see:

2017/06/03 12:06:40 [error] 16254#16254: *7 client intended to send too large body: 1778665 bytes

fastcgi_param PHP_VALUE "upload_max_filesize = 10M \n post_max_size=12M" in nginx conf doesn't help too.

So, how can I increase max upload file size?

2 Answers2

8

You need to check the active .ini settings via PHP's phpinfo() function from a script that you are executing via PHP-FPM. Running php --ini shows settings that apply to the command line PHP, which might be different from PHP-FPM.

To change PHP-FPM php.ini values, you need to edit the pool configuration file, and add

php_admin_value[post_max_size] = 12M
php_admin_value[upload_max_filesize] = 10M

These will change the INI settings applied to the PHP-FPM pool you are running.

Alternatively you can look up the php.ini file for your PHP-FPM setup and change the setting over there.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
7

nginx have its own option called client_max_body_size that can be defined for http, server and location context. Check whether that options is set to non-zero value or not. You can set it to zero to disable body size checkout and then only PHP settings become actual.

Kondybas
  • 6,964
  • 2
  • 20
  • 24