# Where Can I Find "apc.enable\_cli"?

**URL:** <https://help.nextcloud.com/t/where-can-i-find-apc-enable-cli/85168>\
**Category:** ℹ️ Support\
**Tags:** php\
**Created:** [June 19, 2020, 1:46pm UTC](https://help.nextcloud.com/t/where-can-i-find-apc-enable-cli/85168 "2020-06-19T13:46:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![milanolarry](https://help.nextcloud.com/letter_avatar/milanolarry/32/6_449c533f586939b6e5f246632a46421f.png) [@milanolarry](https://help.nextcloud.com/u/milanolarry)\
**Post date:** [June 19, 2020, 1:46pm UTC](https://help.nextcloud.com/t/where-can-i-find-apc-enable-cli/85168/1 "2020-06-19T13:46:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Thom1](https://help.nextcloud.com/user_avatar/help.nextcloud.com/thom1/32/43669_2.png) [@Thom1](https://help.nextcloud.com/u/Thom1)\
**Post date:** [June 19, 2020, 2:56pm UTC](https://help.nextcloud.com/t/where-can-i-find-apc-enable-cli/85168/2 "2020-06-19T14:56:26Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![milanolarry](https://help.nextcloud.com/letter_avatar/milanolarry/32/6_449c533f586939b6e5f246632a46421f.png) [@milanolarry](https://help.nextcloud.com/u/milanolarry)\
**Post date:** [June 19, 2020, 2:58pm UTC](https://help.nextcloud.com/t/where-can-i-find-apc-enable-cli/85168/3 "2020-06-19T14:58:40Z")

</div>

Thanks…

---

<div class="post-metadata">

**Author:** ![Thom1](https://help.nextcloud.com/user_avatar/help.nextcloud.com/thom1/32/43669_2.png) [@Thom1](https://help.nextcloud.com/u/Thom1)\
**Post date:** [June 19, 2020, 3:07pm UTC](https://help.nextcloud.com/t/where-can-i-find-apc-enable-cli/85168/4 "2020-06-19T15:07:25Z")

</div>

I have this in my apc.ini:

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

---

<div class="post-metadata">

**Author:** ![Davoud](https://help.nextcloud.com/user_avatar/help.nextcloud.com/davoud/32/39549_2.png) [@Davoud](https://help.nextcloud.com/u/Davoud)\
**Post date:** [July 16, 2021, 7:03pm UTC](https://help.nextcloud.com/t/where-can-i-find-apc-enable-cli/85168/5 "2021-07-16T19:03:56Z")

</div>

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:

> <https://stackoverflow.com/questions/1245242/php-apc-in-cli-mode>

7- it’s done!

---

<div class="post-metadata">

**Author:** ![StWenzel](https://help.nextcloud.com/user_avatar/help.nextcloud.com/stwenzel/32/51548_2.png) [@StWenzel](https://help.nextcloud.com/u/StWenzel)\
**Post date:** [May 21, 2023, 6:42pm UTC](https://help.nextcloud.com/t/where-can-i-find-apc-enable-cli/85168/6 "2023-05-21T18:42:49Z")

</div>

In my installation with 7.4 fpm I had to add it to the php.ini in the cli folder (i.e. /etc/php/7.4/cli/php.ini), if you run php from the cli, for example for the cron jobs of nextcloud.

And check always what version a pure php invoke at the command line will give you by executing `php -v`. I had an installation with php 8.1 in the apache config, but cli was using php 8.2! Normally there is a soft link to the used version for` /usr/bin/php`

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 14, 2024, 3:56pm UTC](https://help.nextcloud.com/t/where-can-i-find-apc-enable-cli/85168/7 "2024-12-14T15:56:13Z")

</div>


