Operating system and version (e.g., Ubuntu 24.04):
ubuntu 22.04
PHP version:
8.2.19
Is this the first time you’ve seen this error? (Yes / No):
no
When did this problem seem to first start?
long time ago before NC28
Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
Portainer Stack
Are you using CloudfIare, mod_security, or similar? (Yes / No)
Yes
Summary of the issue you are facing:
As requested by Josh, I repost this issue here
I use docker-compose down and docker-compose up -d with - PHP_MEMORY_LIMIT=1024M as parameter in the docker-compose.yml file in the environment section.
However, when checking using php -r "echo ini_get('memory_limit') . PHP_EOL;" it still shows 512M.
Steps to replicate it (hint: details matter!):
Use docker-compose to start a NC container.
With “- PHP_MEMORY_LIMIT=1024M” in the environment section of nextcloud app
You will see it is still 512M when using php -r "echo ini_get('memory_limit') . PHP_EOL;"
Is this command called from within the runing docker container?
Are you aware, that you only see the memory_limit from the cli SAPI of php when running that on the console, which has nothing to do with the php-SAPI which is used by the webserver.
The Memory limit showed in the serverinfo tab of your nextcloud webinterface is the one that matters. There is no way to see that value on the console.
I wrote a php.ini with all the parameters that Nextcloud needs. Also the PHP_MEMORY memory value. The php.ini is mounted to Docker:
xxxx:/usr/local/etc/php/conf.d/php.ini
Run docker compose config to see if the PHP_MEMORY_LIMIT is showing up there as expected
Run set | grep LIMITinside the Nextcloud app container to see if the variable is making its way there
P.S. You’re running a very old and insecure version of Nextcloud Server (29.0.0). Please make sure you’re running up-to-date maintenance releases (29.0.10 currently).