PHP memory limit is below the recommended value

any time I run occ commands, the log says:
The current PHP memory limit is below the recommended value of 512MB.

I definitely have
memory_limit = 512M
in my php.ini

phpinfo() output:

Are you sure you’re looking at the right phpinfo output? This lists PHP 7.4 which isn’t supported by any current version of Nextcloud.

1 Like

That looks like phpinfo() from accessing PHP via the web. PHP has separate configuration files for each run mode: web, fpm, cli, etc. Check all your configs.

2 Likes

occ is driven by php-cli. You normaly cannot see the information of php-cli on the web served php-info, since that one shows the information of that SAPI (Server API), eather apache2 php module or php-fpm.

You get the phpinfo of your php-cli (the one used with occ) with php -i.
So this gives you the information you need:

 php -i | grep memory_limit

If you want to see the beautiful graphical phpinfo() of your php-cli, you must follow this steps:

  1. Create a file named phpinfo.php and add the following content:
<?php
phpinfo();
?>
  1. Open a terminal or command prompt.
  2. Navigate to the directory where you saved phpinfo.php.
  3. Run the following command to start the PHP built-in web server:
php -S localhost:8000

(Replace localhost:8000 with the desired host and port if needed.)

  1. Open your web browser and go to http://localhost:8000/phpinfo.php. You should see the PHP information page generated by phpinfo().

Remember to stop the PHP built-in server when you’re done by pressing Ctrl + C in the terminal where the server is running.

But as you see, it is way easier to run php -i :wink:

Much luck,
ernolf

1 Like

Mine doesn’t, or at least not accessible to me

it turns out my provider had switched to ea-php (not sure why that would matter). But I switched it back to alt-PHP and the message is gone.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.