11

With apache+php_mod it was as easy as putting:

php_value      memory_limit        128M

into application vhost.

How can I do something like this for nginx+php-fpm?

clime
  • 427
  • 1
  • 7
  • 15

1 Answers1

24

You've got a couple of options. You can either:

  1. Set the fastcgi_param of PHP_VALUE to be the relevant setting in the nginx configuration: fastcgi_param PHP_VALUE "memory_limit = 128M";

  2. Set it via the php_value setting in the FPM pool configuration file. Something like php_value[memory_limit] = 128M. Use php_admin_value if you don't want the setting to be overridable via ini_set.

wxactly
  • 103
  • 3
growse
  • 8,020
  • 13
  • 74
  • 115