1

I get this message immediately after reboot trying to run a php script:

# sudo -u apache php updater.phar 
Mon Jul 31 17:59:24 2023 (2241): Fatal Error Insufficient shared memory!

It is a Nextcloud upgrade script. Also these messages in the Nextcloud overview panel:

enter image description here

Nexcloud was working a few days ago. Everything else is running correctly.

# cat /etc/php.d/10-opcache.ini | grep -i interned
; The amount of memory for interned strings in Mbytes.
;opcache.interned_strings_buffer=8
opcache.interned_strings_buffer=256

When I try to run the cron job:

# sudo -u apache php /var/www/html/nextcloud/cron.php
Mon Jul 31 18:20:55 2023 (2785): Fatal Error Insufficient shared memory!
# sudo -u apache free -m
               total        used        free      shared  buff/cache   available
Mem:           31626         985       30569          25         470       30640
Swap:          16383           0       16383
# ipcs -lm

------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 18014398509465599
max total shared memory (kbytes) = 18446744073709551612
min seg size (bytes) = 1

# ipcs -ma

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages    

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x00487d1d 0          postgres   600        56         6                       

------ Semaphore Arrays --------
key        semid      owner      perms      nsems     
# php -i | grep "Loaded Configuration File"
Loaded Configuration File => /etc/php.ini

# cat /etc/php.ini | grep -i memory_limit
memory_limit = 512M

# sudo -u apache cat /etc/php.ini | grep -i memory_limit
memory_limit = 512M

Any ideas?

EDIT

If I change

opcache.interned_strings_buffer=256

to

opcache.interned_strings_buffer=64

It works

Clodoaldo Neto
  • 118,695
  • 26
  • 233
  • 260
  • `ipcs -lm` gives very high values on my machine too, I think these are irrelevant. Try to run `sudo -u apache free -m` and add the output it in your question. I'm not sure that we can answer this question: how is that website hosted? – A.L Jul 31 '23 at 18:21
  • @A.L Added. It is hosted in a dedicated server running RockyLinux 9. 32GB memory – Clodoaldo Neto Jul 31 '23 at 18:26
  • There should be no memory limit when running PHP through CLI: `grep memory_limit /etc/php/8.2/cli/php.ini` or [`php -r "echo ini_get('memory_limit');"`](https://stackoverflow.com/a/56056072/2257664) gives me `-1` (Debian 12). Does it work differently for your `apache` user? – A.L Jul 31 '23 at 18:28
  • @A.L I added to the question the command for both root and apache and the result is the same. – Clodoaldo Neto Jul 31 '23 at 18:31
  • `/etc/php.ini` may not be used when running PHP through CLI. Please share the output of [`php -i | grep "Loaded Configuration File"`](https://stackoverflow.com/a/17850801/2257664). Then check the memory limit defined in this file. – A.L Jul 31 '23 at 18:52

0 Answers0