Php memory size

still hasn’'t been fixed



Can you post more details? Can you post an error? We need more information to help you.

Fatal error: Allowed memory size of 2097152 bytes exhausted ( tried to allocate 438272 bytes ) in /var/www/html/3rdparty/composer/autoload_real.php on line 37

basically any php occ command will fail with this

and solution is very simple add PHP_MEMORY_LIMIT=512M to every command i run

but my question is, if the solution is so simple, why can’t we automate it ?

You can set the memory limits in the php config… So it’s up to you to configure your nextcloud properly…

mate, default config doesn’t even support vanilla install, i have plenty of ram, in fact i have 32GB of ram on this machine and mostly just sits idle

Maybe I’m missunderstanding you, but as long as the php limit is low your 32GB are never used… What you can do is to set the memory level in the basic config of php, so you don’t need the parameter for every occ command fired.

You have to change the following line in the php.ini file on your server from…

memory_limit = 128M


memory_limit = 512M

With 32GB I would recommand to go even higher, especially if you are using PHP-FPM. 4096M would probably be a good value in your case.

On Ubuntu/Debian based systems the php.ini file is located in /etc/php/7.4/apache2/ or in /etc/php/7.4/fpm/ if you are using FPM.

but this app is dockerized … this php config is default.

m point is, 128MB is obviously not enough for nextcloud so why is this default? why isn’t 512 default?

meh, forget it

If you had mentioned that in your initial post, I could have saved myself the effort of answering you and someone else might have been able to give you the correct answer instead.

I don’t know. I don’t use the docker images.