NC13: "Memcache \\OC\\Memcache\\APCu not available for local cache"

I’m running Nextcloud 13.02 on Ubuntu 16.04.4 x64.

 
nextcloud.log

I found that after executing php occ prview:generate-all

{"reqId":"kAvXDNPPClLiqsw6oKJL","level":1,"time":"2018-04-28T12:59:25+00:00","remoteAddr":"","user":"--","app":"cli","method":"--","url":"--","message":"Memcache \\OC\\Memcache\\APCu not available for local cache","userAgent":"--","version":"13.0.2.1"}

 
This is what i have installed:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial


php -v | grep PHP
PHP 7.0.28-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group


dpkg --list | grep apcu
ii  php-apcu       5.1.3+4.0.10-1build1    md64    APC User Cache for PHP


php -m | grep apcu
apcu

 
phpinfo

 
config.php

  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' => array (
              'host' => 'localhost',
              'port' => 6379,
            ),

 
Redis

dpkg --list | grep redis
ii  libhiredis0.13:amd64   0.13.3-2                    amd64  minimalistic C client library for Redis
ii  php-redis              2.2.7-389-g2887ad1+2.2.7-1  amd64  PHP extension for interfacing with Redis
ii  redis-server           2:3.0.6-1                   amd64  Persistent key-value database with network interface
ii  redis-tools            2:3.0.6-1                   amd64  Persistent key-value database with network interface (client)


netstat -putan|grep redis
tcp    0   0   127.0.0.1:6379  0.0.0.0:*        LISTEN      12985/redis-server
tcp    0   0   127.0.0.1:6379  127.0.0.1:41714  ESTABLISHED 12985/redis-server


redis-server -v
Redis server v=3.0.6 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=687a2a319020fa42

phpredisadmin

 
Nextcloud system check OK

What is going wrong here?
Thank you!

1 Like

To avoid this info messages, you need to enable APCu for CLI requests as well, to cover occ and cron.php. By default it’s just enabled for webserver requests.

echo 'apc.enable_cli=1' >> /etc/php/7.0/mods-available/apcu.ini

4 Likes

What should I do under centos7.2?

There should be a similar folder with those mods .ini foldes on centos. I would have said, as it’s by default PHP5, that it would be /etc/php5/mods-available/apcu.ini but found some source, that it might be /etc/php.d/apcu.ini.
It might be even apc.ini, not sure, just have a look inside the folders above and be sure of course assure, that the APCu module for PHP is installed.

€: Ah find / -name 'apcu.ini'? :smile:

In case helps others…

On BSD: /usr/local/etc/php/ext-NN-apcu.ini

1 Like

1,

sudo apt install php-apcu

2, Modify your:
/etc/php/X.Y/mods-available/apcu.ini like this
extension=apcu.so
apc.shm_size = “50M”

(Only those two lines. 50 MB is can be other.)

3,Edit your /your_path/nextcloud/config/config.php file by adding a new line:
‘memcache.local’ => ‘\OC\Memcache\APCu’,

(The “’\\OC\\Memcache\\APCu,” is very bad it can causes Internal Server error.
Unfortunetly the Internet is full of that double backslash comments.

(More: https://docs.nextcloud.com/server/15/admin_manual/configuration_server/caching_configuration.html#id1 )

3 Likes