docker icon indicating copy to clipboard operation
docker copied to clipboard

Add environment var to set `apc.shm_size` php config

Open LeSnake04 opened this issue 4 months ago • 1 comments

When I got the warning that the apc.shm_size is almost full It took me a long time to figure out how to cleanly fix it in docker and where the config PHP is stored.

It feels a bit odd to me that a setting that the docs recommend to change requires me to figure out where the PHP config dir is and add a file to it.

I would suggest adding a PHP_APC_SHM_SIZE environment variable similar to PHP_UPLOAD_LIMIT.

LeSnake04 avatar Aug 28 '25 21:08 LeSnake04

Agreed. I have no idea where the correct php.ini is.

saschabrockel avatar Nov 22 '25 23:11 saschabrockel

When I got the warning that the apc.shm_size is almost full It took me a long time to figure out how to cleanly fix it in docker and where the config PHP is stored.

And which file was the right one to edit this option?

cpunk avatar Dec 14 '25 00:12 cpunk

And which file was the right one to edit this option?

I added the line apc.shm_size=128M to the file /etc/php/8.2/cli/conf.d/20-apcu.ini did a systemctl restart php8.2-fpm.service and the warning disappeared. It would have been really nice if there had been a note about this somewhere.

cpunk avatar Dec 18 '25 23:12 cpunk