Mastodon Mastodon - Nextcloud out-of-memory PHP error
 logo
  • Home 
  • Tags 
  • Blog posts 
  1. Home
  2. Blog posts
  3. Nextcloud out-of-memory PHP error

Nextcloud out-of-memory PHP error

Posted on April 3, 2021  (Last modified on July 11, 2024) • 1 min read • 91 words
Nextcloud   Solved   Docker  
Nextcloud   Solved   Docker  
Share via

I got this error when upgrading to nextcloud 21:

PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) [...]

Turns out this is the way to solve it: Prefix PHP_MEMORY_LIMIT=512M to the commands. In combination with docker it looks like this:

/usr/bin/docker exec -u 33 srv_nc_1 /bin/bash -c 'PHP_MEMORY_LIMIT=512M php occ db:add-missing-indices'

... OR USING -e ...

/usr/bin/docker exec -u 33 -e PHP_MEMORY_LIMIT=512M srv_nc_1 /bin/bash -c 'php occ db:add-missing-indices'

... OR MANUALLY ...

~$ docker exec -tiu 33 srv_nc_1 /bin/bash
~# PHP_MEMORY_LIMIT=512M php occ db:add-missing-indices

Source: https://is.gd/mua5wv

 Nextcloud cron job
Powershell Script Base 
In case you want to follow me

Here are some links. The further to the right, the less active.

           
(c) Axel Bock | Powered by Hinode.
Link copied to clipboard
Code copied to clipboard