Nextcloud.occ config:system:set memory_limit=512?

Latest 25 version snap install of nextcloud but I wanted to test the document server. It’s installed but doesn’t open, it just sits and spins. How can I allocated more PHP memory to the processes? I tried this command but it didn’t work:

nextcloud.occ config:system:set memory_limit=512

It just emptied the string and spat and error:

root@cloud:~# nextcloud.occ config:system:set memory_limit=512
System config value memory_limit=512 set to empty string

How can I used the occ command to adjust php memory values?


Hi @wolfsden3

I am not aware that you could adjust the PHP memory limit via occ command…

The -d memory_limit=512M parameter to which you probably refer, as described here, only works on the command line and on a per command basis, meaning it only increases the value once, for the specific command you are running at that time. This can be useful, for e.g. installing large apps. However, If you want to set the higher value globally and permanently you have to change the value in the php.ini files of your PHP installation.

On Debian / Ubuntu systems, you can find the php.ini files in /etc/php/8.1/cli and /etc/php/8.1/fpm respectively. Obviously, you have to change the version number in the path to the the version that you are actually using.

1 Like

memory_limit is defined in settings for PHP, not Nextcloud config.php

php.ini files is where you gotta look m8. Possible locations:

  • /etc/php/8.1/php.ini
  • /etc/php/8.1/fpm/php.ini
  • /etc/php/8.1/cli/php.ini

The 8.1 is jsut an example. Swap with the PHP version you are running. A piece of advice though: The /cli/ is the PHP library used when executing OCC commands and by the cron job. Only the actual web site/web application is consuming one of the others.

If running Apache2 php mod, then it is the first ini file. If running php-fpm, it is the fpm path.

1 Like

You have the command wrong. See the snap docs:

Note, I don’t believe the community Snap supports Office (CODE) in the Snap. I believe you have to use an external deployment.