PHP memory limit warning

Nextcloud version 20.0.5
Operating system and version: Ubuntu 18.04
Apache or nginx version: Apache 2.4.25

In Overview | Security & setup warnings , I am getting the warning:
The PHP memory limit is below the recommended value of 512MB

I have made the following change to /etc/php/7.4/apache2/php.ini:
memory_limit = 512M but the warning persists.

Does any one have any thoughts on what might be happening?

Any assistance would be most appreciated.

P

Hi @DoctorP

a few ideas to check:

  • is the PHP version (7.4) you are configuring the one that is actually used by your Apache? Or could it be that it runs 7.3? Or PHP FPM which would need a seeting in /etc/php/7.4/fpm/php.ini?
  • does the warning go away when you set it to 513MB?
  • Sorry for this one - but have you restarted PHP/your webserver?

/Simon

Thank you Simon. In response to you different questions…

PHP version: the reply to php -v is
PHP 7.4.14 (cli) (built: Jan 13 2021 08:04:06) ( NTS )

Setting in /etc/php/7.4/fpm/php.ini?
I was not aware about fpm. I changed memory_limit to 512M, the restarted Apache. I’m still getting the warning.

Does it possibly require a reboot of the system?

Again. Thanks.

P

Hi,

PHP can have different configurations for different environments. They are all placed in /etc/php/7.4/. There should be

  • cli which controls the parameters for the command line, when you execute php as you have for your answer
  • fpm if you are using PHP-FPM this is the one that needs changes for the processes run by the webserver. After changing you would need to restart just PHP-FPM, not your entire server
  • If you are using Apache’s PHP module, then there should be an apache folder and you would need to set it there and restart Apache.

Chjeers,
Simon

Simon:

Thanks for the reply. Apologies for the delayed response…been crazy here.

Checked and set memory_limit = 512M in
/etc/php/7.4/cli/php.ini
/etc/php/7.4/fpm/php.ini
/etc/php/7.4/apache2/php.ini

Then restarted Apache.

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

Hmmm.

P

Did you restart also PHP-FPM? I still don’t know which PHP you are actually using… :slight_smile:
Or just restart the mahcine to be safe. :wink:

I’m using PHP 7.4. Is there anything more specific? As for restarting PHP-FPM, all I could find was to restart Apache.

I guess a machine reboot is in order.

Thanks for your help.

P

service php7.4-fpm restart

What I meant is that even with Apache you have the option to use PHP-FPM or the builtin php module of Apache. Let’s see what the thing says after restart. :slight_smile: