Memory limit on webspace without server access

Hi All,

I’m running NC 24 on a webspace without access to the system configuration. Basically I have no problems, but in the settings it displays the message “The PHP memory limit is below 512M”, which is correct because it’s set at 256M by the provider (and they don’t change it).

When running a script from the SSH command line, I can assign 512M to a script by using the following command:

php -d memory_limit=512M skript.php

This lets me ask two questions:

  • Can I modify the nextcloud scripts somewhere to use a command line like this?
  • From my experience it’s not absolutely necessary to have 512M, because my system is running fine. Is this really necessary or can I continue with 256M?

Thank you all

Memory consumption of an actual instance depends a lot on the specific setup. The more things you use, the more memory you need. If you are on a very limited setup and you use just some basic fonctionality, perhaps the 256M is enough, but make sure that you don’t need more during the update process. And there is a risk, once you add more files and more stuff to your Nextcloud, that is hits the limit.

It depends a bit on your provider, perhaps you can change the limits with .htaccess or similar things (check their documentation). Not sure if it works within the code (How do I set the maximum php memory limit - Stack Overflow). PHP configuration to run on command line or via http can be different!

However, even 512M wouldn’t be much. I wouldn’t bother with such systems. Raspberry Pi can run Nextcloud as well (check out NextcloudPi), or use local virtual machine.

You must differ between php cli and php apache2.

On normal systems you can set it e.g. at /etc/php/apache2/php.ini

Maybe you can modify the setting in /path/to/nextcloud/.htaccess. Sorry not tested:

php_value memory_limit 512M

But maybe your hoster doesn’t allow it. Maybe ask your hoster.
If everything works well, you may be able to do without it.


Thank you for this advice!

But you are correct, my hoster doesn’t allow this. I can only use the mentioned command line via SSH.

On some server configurations it is possible to change PHP settings via htaccess or using a predefined file. That depends on your hoster. For example my private hoster is ionos - years ago that was 1&1 and they accept a php.ini file in the document root directory to change the php settings without touching the original php.ini.


Thanks Michael,

I’ll try again, but it looks like my hoster (hosteurope) doesn’t allow any changes that last longer than one command via SSH.