Unable to set memory cache

Good evening guys, I installed version 10.2.1, with php 7.2, when I go to edit the config.php file by entering the Memory Caching parameters, following the guide, when I reload the page I get the following error:

Blockquote Preformatted textMemcache \OC\Memcache\APCu not available for local cache Is the matching PHP module installed and enabled?Preformatted text > Blockquote

Blockquote Preformatted textMemcache \OC\Memcache\Redis not available for local cache Is the matching PHP module installed and enabled?Preformatted text > Blockquote

the modules are clearly installed

Hi nemo87,
Can double check that the module is installed and install a PHP info file on the web server to check it’s actually working?
On Ubuntu or Debian:

dpkg -l | grep apc

Check whether the PHP CLI loads it:

php -m | grep apc

Now install the php-info:

cd /path/to/owncloud
#I assume the following file 'php-info.php' doesn't exist
echo '<?PHP phpinfo(); ?>' > php-info.php  
chown php-info.php  --ref index.php
chmod php-info.php  --ref index.php

Now go to your browser and enter into the URL bar:

http[s]?://your.owncloud.tld/php-info.php

Just hit Ctrl+F and search for ‘apc’
If all of these tests succeed the APC module is correctly installed.

Could you also paste your config.php (but remove the sensitive data)?
Thanks

1 Like

Hello, thanks for the answer and sorry for the delay in answering, I had a bit of difficulty with the internet …

Blockquote /home/pi# dpkg -l | grep apc
ii php-apcu 5.1.17+4.0.11-1 armhf APC User Cache for PHP
ii php-apcu-bc 1.0.4-4 armhf APCu Backwards Compatibility Module
root@Capsule:/home/pi# php -m | grep apc
apc
apcu

However, trying “apc” on info.php I have no result …

config.php:

Blockquote**<?php**

$CONFIG = array (

’instanceid’ => ‘ocrgm3agop2m’ ,

’passwordsalt’ => ‘HEJJbKVn3JIsvjqLUwBK8aJqrzfTbX’ ,

’secret’ => ‘d6uyyCtTfsYFaf7kLQMKsb3QD7wVOXFho+sEMjeL1URsogrQ’ ,

’trusted_domains’ =>

array (

0 => '192.168.1.’** ,

),

’datadirectory’ => ‘/mnt/data’ ,

’overwrite.cli.url’ => 'http://192.168.1./owncloud’** ,

’dbtype’ => ‘mysql’ ,

’version’ => ‘10.2.1.4’ ,

’dbname’ => ‘owncloud’ ,

’dbhost’ => ‘localhost’ ,

’dbtableprefix’ => ‘oc_’ ,

’dbuser’ => ‘hercules’ ,

’dbpassword’ => '****’ ,

’logtimezone’ => ‘UTC’ ,

’apps_paths’ =>

array (

0 =>

array (

’path’ => ‘/var/www/owncloud/apps’ ,

’url’ => ‘/apps’ ,

’writable’ => false,

),

1 =>

array (

’path’ => ‘/var/www/owncloud/apps-external’ ,

’url’ => ‘/apps-external’ ,

’writable’ => true,

),

),

’installed’ => true,

’memcache.local’ => ‘\OC\Memcache\APCu’ ,

’memcache.local’ => ‘\OC\Memcache\Redis’ ,

’redis’ => [

’host’ => ‘localhost’ ,

’port’ => 6379,

],

’memcache.locking’ => ‘\OC\Memcache\Redis’ , // Add this for best performance

);

No worries.
On Ubuntu you should be able to enable APCu with the following command:

phpenmod apcu

This should create the symlink /etc/php/7.2/apache2/conf.d/20-apcu.ini pointing to /etc/php/7.2/mods-available/apcu.ini

root@ubuntu1804:/var/www/owncloud# ls -al /etc/php/7.2/apache2/conf.d/20-apcu.ini
lrwxrwxrwx 1 root root 36 May 24 12:57 /etc/php/7.2/apache2/conf.d/20-apcu.ini -> /etc/php/7.2/mods-available/apcu.ini

If you’re using a different PHP version your path might be slightly different than mine.

Afterwards you will have to restart the apache server:

systemctl restart apache2

Then your test with the phpinfo file should succeed and APCu should be available to ownCloud.

1 Like

Now from the redis error, but if I delete lines from the config file concerning redis leaving only apcu the previous error returns (although the file apcu appears in the php.info file)

Thanks for your patience.

**’memcache.local’** => **‘\OC\Memcache\APCu’** ,
**’memcache.local’** => **‘\OC\Memcache\Redis’** ,

There can only be one, and I think memcache.local should always be APCu.
For Redis you will want to have the package ‘php-redis’ installed and enabled.

1 Like

I solved, thanks for your patience and help

2 Likes