Where Can I Find "apc.enable_cli"?

I would like to set up memory caching and find that I need to set " `apc.enable_cli " to 1 in php.ini. First, there are more than one php.ini files in my system, which one should I modify? (…7.3/fpm/php.ini or …7.3/cli/php.ini) Second, after searching through the two files, I cannot find any lines that contain “apc.enable_cli=1”, should I add it to the two files? Thanks.

Hi,

Be sure you have installed apcu module for php. You can uncomment/add these lines in your php.ini or php.d/apcu.ini for example:

extension=apcu.so
apc.enabled=1

Thanks…

I have this in my apc.ini:

extension=apcu.so
apc.enabled=1
apc.shm_size=32M
apc.ttl=7200
apc.enable_cli=1
1 Like

For enabling ‘apc.enable_cli’ in php.ini do below steps: (ubuntu + LAMP)
a. sudo apt install php7.4-cli php7.4-common php-apcu
1- if your server runs PHP-FPM
2- try to find php.ini for instance (/etc/php/7.4/fpm/php.ini)
3- we have to add { apc.enable_cli } line inside php.ini file
4- if your server runs Apache PHP module then
try to find for instance( /etc/php/7.4/apache2/php.ini)
5- sudo systemctl reload apache2
6- sudo systemctl restart php7.4-fpm
for more information read below article:

7- it’s done!