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

NC14.0.3 + Debian 9 + PHP 7.2:

After every occ command comes:

The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
The current PHP memory limit is below the recommended value of 512MB.

But i have definitely 513 MB memory_limit.

How can i let the error message disappear?

You are sure about the limit?

php -i | grep memory_limit

It can and it is in general different if you call php from command line or via browser. What is a bit difficult is that the value can be changed at different locations. Therefore, the most reliable test is to put a small script which shows you the limit.

sudo -u www-data php72 -i | grep memory_limit
memory_limit => 128M => 128M

But phpinfo.php is showing me 513 MB

You have two php.ini files in your system:

  • /etc/php/7.2/cli/php.ini (for php CLI)
  • /etc/php/7.2/apache2/php.ini (used by the webserver)

When you do a GET /phpinfo.php you’re calling the webserver, when you run php72 -i | grep memory_limit the other config file is used.

I believe that occ commands use the CLI ini file.

1 Like

Hi guys, the easiest way to fix the message is the following:

sudo gedit /etc/php/7.2/apache2/php.ini

then look for:

[memory_limit] = 512M

After chaging to 512M restart apache

sudo systemctl restart apache2.service

I’ve done that but I still get the message, even after a full server reboot

Same here. Also modified the entry in fpm/php.ini, message still remains. Maybe it’s related to the -1 entry for cli? (I assume that’s “unlimited”?) Or maybe because it’s “memory_limit” without brackets in PHP7.3’s php.ini?

same problem (v16.0.3.0)
in
/etc/php/7.3/cli/php.ini
I set
memory_limit = 1000M
then
sudo -u www-data php7.3 -i | grep memory_limit
yields
memory_limit => 1000M => 1000M
but the error after reboot is still there

Normally, in this output it should also tell you which configuation file is used:

sudo -u www-data php7.3 -i

I’m wondering if php also takes other files in the folder into accound (like .htaccess or user.ini)…

Actually plenty, it seems: https://pastebin.com/uJ0icJqX

This is the main one:
/etc/php/7.3/cli/php.ini

The others are included from there.

There is a third php.ini in play. If you’re using php-fpm, wich is likely, chances are your system is using /etc/php/7.3/fpm/php.ini. And that’s where you go to fix it. Restart php-fpm, and you’re done.

The 7.3 may be 7.2 or different, depending on what you use, of course. A phpinfo.php file will tell you exactly what the webserver is using.
Creating a phpinfo.php file is easy: create a text file, and put:

<?php
phpinfo();
?>

in it. Save as phpinfo.php and put it on your webserver. Call it from your browser and check output.

Good luck!