Mobile app version of vmapp.org
Login or Join
LarsenBagley505

: Difference Between php_admin_value[memory_limit] and php.ini memory_limit I have Nginx + php-fpm + Mysql. With the php memory settings, I always set this in php.ini like this: memory_limit = 256M

@LarsenBagley505

Posted in: #Debian #Nginx #Php

I have Nginx + php-fpm + Mysql. With the php memory settings, I always set this in php.ini like this:

memory_limit = 256M


Now, I bumped into another similar looking setting in pool.d/www.conf file like this:

;php_admin_value[memory_limit] = 32M


My questions:

Although the doc says what that does, I couldnt read anywhere on what's the difference between memory_limit setting in php.ini and the php_admin_value[memory_limit] in conf?

Do I need to set both or setting both makes it redundant?

Under what scenario do I need to specify the limit in php_admin_value[memory_limit] instead of adding it to memory_limit in php.ini?

Can someone clear my confusion please?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @LarsenBagley505

2 Comments

Sorted by latest first Latest Oldest Best

 

@Rivera981

One difference between memory_limit = 256M in php.ini and php_admin_value[memory_limit] = 32M in pool.d/www.conf is that you can use ini_set('memory_limit','512M') to override the setting in php.ini but you can't override values set with php_admin_value.

Use php_value[memory_limit] = 32M if you want to allow it to be overridden. (php_value vs php_admin_value)

10% popularity Vote Up Vote Down


 

@Chiappetta492

There is no difference. There are different ways to set the same PHP configuration parameter.
It's useful - for example - if you have a generic php.ini which gets loaded in all PHP-FPM pools, but in one of them you want to override a certain value - like memory_limit

See php.net/manual/en/configuration.changes.php

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme