Allowed memory size exhausted even if correct PHP MEMORY LIMIT

I use Nextcloud 24.0.5 on my vserver with Plesk. I set the following parameter in PHP

  • Version: 8.0.24
  • Speicherlimit: 512 MB
  • Maximale Ausführungszeit: 3600
  • Maximale Größe zum Hochladen: 20 MB

But I will get the following message

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8408552 bytes) in nc/apps/maps/lib/Helper/ExifGeoData.php on line 120

Also I can’t update with the online updater because I will get the same error.
What have I to do to avoid this problem?

Thank you for your help.

1 Like

here you are limited to 128 MB. There are different locations where you can set the configuration, so your setting of 512 MB seems to be overwritten somewhere…

Depending of the php model you are using, the config ini file location changes.
FPM model, ie, locates, on ubuntu, in /etc/php/[your active version]/fpm/php.ini
Check your setup, and review your settings file.

placing the memory override in a user.ini in your root of nextclouds domain might help, particularly so with some shared host s. but check your phpinfo() at that folder/domain to find the ini in use. (empty file with < . ? . php \n phpinfo(); )

1024MB i find is the sweetspot for me,

Ok. The problem was caused by the cron script which is configured in plesk. I added the -dmemory_limit parameter to the cron entry. Know it works.


Maybe something to mention that happened to me:

Using php-fpm and allthough in its settings there was 1024M memory_limit, I suddenly once got the error from crontab every 5 minutes. Even changing this limit didnt help …

… until I remembered, that the crontab is using a different basic php.ini in my case (…/cli/php.ini) where it was by far too low (128M)

Maybe this helps one or the other since I landed here before I found my issue myself :wink:

thanks for this. Could you provide a more detailed description how to solve this? I am still struggeling to understand what you did.

I‘ve found the solution for me as well. In case anyone else is searching for answers, I’ll share mine here as well:

In the cron script settings ad the following arguments:

php -d memory_limit=512M

1 Like