2

I'm using Apache with php-fpm on a RHEL8 system. php-fpm was installed from remi repo in version 7.2.

I've added a file .user.ini in a web accessible folder to set memory_limit=256M (default of /etc/php.ini is 128M). It seems to work. But I detected that the value does 'not always' seems to be applied immediately if I change it. I checked that by repeatedly calling a page that outputs phpinfo();. Sometimes the value is changed, sometimes not.

I guess that it is php-fpm with its process pool (if I did understand that correctly). New processes will have the new value. Old values the old one. And if a page gets called, you never know which process actually responds.

I think reloading php-fmp (systemctl reload php-fpm.service) resets those processes and each has the updated value.

Can anyone explain how it works exactly? What is important to know, about .user.ini and php-fpm? Can it be that some request will use the old value forever?

1 Answer 1

1

From the linked documentation page, see user_ini.cache_ttl which define the TTL (Time To Live) of .user.ini file.

  • Large value is better for performance, so for production
  • Small value can be useful for development

Default value is 300, 5' which can seems long.

Sign up to request clarification or add additional context in comments.

2 Comments

Ok, thanks. And is systemctl reload php-fpm.service a way to force applying the values immediately?
Reloading or restarting the FPM service doesn't forces it to reread the values. The only way it's to modify the value to a lower one, reload/restart and edit another time writing the old ttl value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.