Hi everyone We've received a PR from Frederik Pytlick (@frederikpyt, thank you!) that introduces a new max_memory_limit INI setting.
https://github.com/php/php-src/pull/18011 This setting declares an upper bound for memory_limit, which will prevent memory_limit from being set to a value higher than max_memory_limit, resulting in a warning (currently an error on startup, but I think this should be changed). It defaults to -1, which is unlimited. While memory_limit can be set at runtime, max_memory_limit is limited to startup. This may be useful to prevent 3rd party libraries from setting the limit unreasonably high. Similarly, it may declare an upper bound in shared hosting environments. One open question is whether exceeding the max_memory_limit should also set memory_limit to max_memory_limit in addition to warning, giving the subsequent operation a higher chance not to straight out OOM error. Let me know if you have a preference in that regard. This seems like a reasonable addition, allowing for more granular memory limit control. Let me know if you have any thoughts or concerns. If not, I'm planning to merge this PR into master in a couple of weeks. Ilija