1

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?

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.

  • Looks like client_max_body_size 0; in the server section of nginx config did the trick. Thanks. – Suvitruf Jun 3 '17 at 13:54
5

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.

  • This changes in pool configuration file didn't help . – Suvitruf Jun 3 '17 at 12:39
  • Did you restart PHP-FPM after changes? – Tero Kilkanen Jun 3 '17 at 14:22
  • Yep, I've restarted fpm and nginx. – Suvitruf Jun 3 '17 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.