PHP setting Default Values

Hi

for virtual servers, there is Resource Limit features for PHP settings. There is Default option to choose instead of typing memory limit and upload etc. I changed it to Default, for example memory_limit, then I can see it's 128M in phpinfo(). But I want to set a limit for default value, where should I change it? I tried /etc/php.ini, /opt/rh/rh-php72/register.content/etc/opt/rh/rh-php72/php.ini , and /etc/opt/rh/rh-php72/php.ini. It doesn't work. I just want to limit the virtual server owners from exceeding my limit.

thanks

Status: 
Active

Comments

Howdy -- thanks for contacting us!

Try changing that setting in $HOME/etc/php.ini, that may fix that for you.

If that doesn't work, which PHP Execution Mode is it that you're using?

Some virtualserver use PHP-FPM, some use FastCGI. Yes, when I make changes in Resource Limit->PHP configuration, that /home/XXX/etc/php72/php.ini was the one get changes. I wanted to know about Default setting option. where should I set default value.

The default you're seeing refers to the PHP default, meaning it wouldn't set it at all in the PHP config. That would cause it to fall back to the PHP default.

When using a php.ini file that's located in the user's home directory, such as with FCGI and CGI, the user would be able to change that to anything they wanted, there's no real way to prevent that.

A way you can prevent users from adjusting the php.ini file, and to use system-defined values, would be to use a PHP Execution Mode like PHP-FPM. That uses a system-wide php.ini file stored in /etc/ rather than in the user's home directory.