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?
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
You've got a couple of options. You can either:
PHP_VALUE to be the relevant setting in the nginx configuration:
fastcgi_param PHP_VALUE "memory_limit = 128M";
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
php_value[memory_limit]. The difference between both, according to the documentation, is that the first cannot be overridden by
ini_set(). Jan 3, 2020 at 21:41