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

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?

1 Like

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
to
memory_limit = 512MB

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

  • 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 (https://internet.nl).
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]

1 Like

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

1 Like

Today I found myself in this problem.

Had in …/php8.0/apache2/php.ini file these values:
upload_max_filesize=1G
post_max_size=1G
memory_limit=512M

Still was nothing.
Finally changed also in …/php8.0/fpm/php.ini as well

Only then worked for me.

Maybe for some one it will helps…

Debian 9 with proper nextcloud installation.

Having RedHat (Fedora, CentOS) I have found out that the SELinux was in some way preventing from updating the memory_limit (tried restart the httpd and the server itself).

My steps were following:

  • Disable SELinux (/etc/selinux/config “SELINUX=permissive”)
  • Reboot the server
  • Enable SELinux (/etc/selinux/config “SELINUX=enforcing”)
  • Reboot the server

The memory limit has been updated.

If somebody can explain what was the issue???

Was having the same issue and this was the fix for me.

1 Like

From the command line, do

php -i

It will show the php configuration info which includes the path to php.ini