The PHP memory limit is below the recommended value of 512MB

JeromeSi’s post was what fixed this for me. These PHP settings are all over the place.

Yes! Correct! If you using PHP-FPM it is need to restart both.
Just change/set the memory_limit = 512M from the /etc/php/7.3/fpm/php.ini and

  • sudo /etc/init.d/apache2 restart
  • sudo /etc/init.d/php7.3-fpm restart

Thank you! :slight_smile:

1 Like

I have php 7.3 and the command
sudo -u www-data php7.3 -i | grep memory_limit
memory_limit => -1 => -1
NO LIMIT ! but I still have the message"The PHP memory…" BUG? or did I miss something?

Guys, create a mod instead of editing all single php.ini files: Die Meldung "PHP-Speichergrenze liegt unterhalb des empfohlenen Wertes von 512MB." verschwindet nicht!

Since one can set a priority, this as well assures that any other or future drop-in config cannot override this setting. php.ini settings are always overridden by any drop-in config or mod.

For PHP 7.3 change /etc/php/7.3/fpm/php.ini
The cli php.ini made no difference.

1 Like

I do not want to increase PHP memory for all users.
Adding this line to user.ini worked fine in NC 15:
memory_limit = 512M

But now this file get’s an error while the checksum is incorrect.
And even worse, after each update this file is overwritten by the update.

So there should be an alternative way to set this option per NC installation, without loosing this setting each update and without getting a checksum failure notification.

Who knows?


The checksum failure seems gone now. But not the overwriting of the existing file. Where do I have to put these custom settings to avoid redoing this every update for alle clouds?

In my case this did not work and from the description of warning it is true that is needed change Memory limit not post_max_size. For me worked this:

Editing the memory limit from
memory_limit = 128MB
memory_limit = 512MB

In my case it was non of the solutions above. For

  • Ubuntu 20.04.1 LTS
  • Nextcloud 19.0.6
  • Apache2.4
  • php7.4-fpm

Using php7.4-fpm as service it was necessary to change file: /etc/php/7.4/fpm/pool.d/www.conf, and set this variable to have 756M to run php

php_admin_value[memory_limit] = 756M

And then restart service php7.4-fpm

Try downgrading php to 7.3 and recompile.

I had a similar issue and using a lower version of pho did the trick.

Thanks, it was helpful

OK. Fine.
Now on NC20 with php7.4. All instances are stable and 100% security (
I get no errors anymore about overwritten settings in the ini file.

After updates there are now every time occ commands that need to be executed. When no maintenance mode is required, the occ plugin works fine and fast. Otherwise you should use SSH login and that takes more time.

I believe the main issue will be performance - giving Nc 1gb or 2gb makes it a fair bit faster. But most things should work with a memory setting between 256 and 512 mb.

1 Like

Thank you for the reply. It’s been so far working without problems even with 384 MB memory limit. It’s a single user instance most of the time and I only use it for occasional file transfers between different iOS devices.

I did adjust the size of preview images in config.php though, in the hope that this would reduce the memory footprint as well as speed up things a little.

‘preview_max_x’ => ‘2048’,
‘preview_max_y’ => ‘2048’,
‘jpeg_quality’ => ‘60’,

Not sure if that accomplishes anything, but it hasn’t caused any problems either.

1 Like

Hello there! Newby here.

I am trying to locate the php, ini file to update the memory limit but I can’t find the folder! I am not sure if the folder is hidden?

I am using Hestia CP admin panel. Any help would be appreciated!!

Screenshot 2021-03-20 at 17.43.43|441x500

Nextcloud 21
Ubnuntu 20
PHP 7.4
Maria DB

I’m running Nextcloud 20.0.8 on Ubuntu 20.04 LTS and I’ve tried every suggestion in this thread I still get the warning in Nextcloud. * The PHP memory limit is below the recommended value of 512MB.
Nextcloud Settings/System PHP reports:
Version: 7.4.16
Memory Limit: 128 MB
Max Execution Time: 3600
Upload max size: 2 MB

When I run php -i | grep “memory_limit” I get
memory_limit => 1024M => 1024M

I’ve edited every php.ini file on the box to increase memory to 1024M.

Nothing works.

Nevermind… Typo in the php.ini line 2
][PHP] should have been [PHP]

Thanks! I made this and now works!

Hello !

I have the same issue : i think i change every config file and i have still the error on Nextcloud…

Where was your typo ?

Okeeey i found out that i had an .htacess in y nextcloud folder where there were some phprules
So I add php_value memory_limit 512M inf the apache module