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

output:
root@nextcloud ~# grep --include=.ini -rnw ‘/’ -e “memory_limit”
grep: ‘/’: No such file or directory
root@nextcloud ~# sudo grep --include=
.ini -rnw ‘/’ -e “memory_limit”
grep: ‘/’: No such file or directory
root@nextcloud ~# grep -R “memory_limit” /etc/
grep: /etc/php/7.4/fpm/conf.d/90-ncp.ini: No such file or directory
root@nextcloud ~# grep --include=.ini -rnw ‘/’ -e “memory_limit”
root@nextcloud ~# grep --include=
.ini -rnw ‘/etc/php’ -e “memory_limit▒▒
grep: ‘/etc/php’: No such file or directory ‘/etc/php’ -e “memory_limit”
-512”nextcloud ~# grep --include=*.ini -rnw ‘/etc/php’ -e “memory_limit = -
grep: invalid option – ‘▒’
Usage: grep [OPTION]… PATTERNS [FILE]…
Try ‘grep --help’ for more information.
root@nextcloud ~#

what’s the matter here??

Your copy paste replaced the hyphens.
Use hyphens from your keyboard instead.

the ’ before and after path. Just delete the two hyphens by hand and type them again using your keyboard.

Great worked but suddenly I’m on PHP 8.0.2
root@nextcloud ~# grep --include=.ini -rnw ‘/etc/php’ -e “memory_limit = -512”
/etc/php/8.2/cli/php.ini:430:memory_limit = -512
root@nextcloud ~# grep --include=
.ini -rnw ‘/etc/php’ -e “memory_limit = -512”
root@nextcloud ~# sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices
This version of Nextcloud is not compatible with PHP>=8.2.
You are currently running 8.2.0.root@nextcloud ~# sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices

BUT in Nextcloud is shown:

What has Happened?

How to go back to 7.4??

Several low practical observations:

Try run that grep command excactly as above, just changing the last parameter to this

grep --include=.ini -rnw ‘/etc/php’ -e “memory_limit =”

Secondly then OCC uses PHP CLI and Nextcloud uses whatever NOT CLI PHP engine you have choosen (Apache2/NGINX, whatever-webserver-you-have-choosen PHP modul or PHP-FPM) to execute PHP.

Using this command excactly like this:

root@nextcloud ~# sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices

Gives issues because (command explained):

Run this command using the system installed and default PHP package as the www-data user.

So if you have updated PHP using apt-get upgrade, it will have installed newest PHP version, hence version 8.2 is the default goto for PHP command. So this error message is correct. Nextcloud is not compatible with PHP 8.2. However you have several PHP versions installed on your system, so all you needs to do is to specify which version to use:

root@nextcloud ~# sudo -u www-data php7.4 /var/www/nextcloud/occ db:add-missing-indices

Great Info THX
Will go through learning :slightly_smiling_face: