Apcu and redis problem

Hi,
I am using apcu in config.local.php

$config['cache_backend'] = 'apcu';

and redis for sessions

$config['session_backend'] = 'redis';

The problem is that i get this error for apcu

Tygh\Exceptions\ClassNotFoundException: "APCu" PHP extension is not installed. in /www/wwwroot/website/app/Tygh/Backend/Cache/Apcu.php:36
Stack trace:
#0 /www/wwwroot/website/app/Tygh/Registry.php(384): Tygh\Backend\Cache\Apcu->__construct()
#1 /www/wwwroot/website/app/Tygh/Registry.php(312): Tygh\Registry::cacheInit()
#2 /www/wwwroot/website/app/Tygh/Registry.php(797): Tygh\Registry::registerCache()
#3 /www/website/app/functions/fn.init.php(1155): Tygh\Registry::getOrSetCache()
#4 /www/website/app/functions/fn.init.php(1227): fn_init_unmanaged_addons()
#5 /www/website/init.php(195): fn_init()
#6 /www/website/admin.php(19): require('/www/wwwroot/ai...')
#7 {main}

Tygh\Exceptions\AException

Message
"APCu" PHP extension is not installed.

Error at
app/Tygh/Backend/Cache/Apcu.php, line: 36

Backtrace
File:app/Tygh/Registry.php
Line:384
Function:__construct

File:app/Tygh/Registry.php
Line:312
Function:cacheInit

File:app/Tygh/Registry.php
Line:797
Function:registerCache

File:app/functions/fn.init.php
Line:1155
Function:getOrSetCache

File:app/functions/fn.init.php
Line:1227
Function:fn_init_unmanaged_addons

File:init.php
Line:195
Function:fn_init

File:admin.php
Line:19
Function:require

And with redis for sessions i cant login on admin or front area.

I changed back to file and database and everything is ok.
Apcu and Redis are installed on the server.
The error for apcu i get when i try execute a cron job

In admin panel

Settings, logs, click on the gear icon on the top right
PHP information

Check that APCu and redis extensions are actually enabled

Redis in enabled

As always, have a current backup, especially if you don’t know what you are doing.

Then redis should work. Must manually clear var/cache after you change the config file.

Hi!

The error from the provided backtrace clearly states that the APCu PHP extension is not installed at your server. Please contact your hosting support/server administrator on this case, or switch the cache_backend back to file.

Is working now, i dont know what was the problem with redis, maybe some cache issues.
I installed APCu and everything is ok.

1 Like

Redis wasn’t involved, just the APCu :slight_smile:

True, for Redis i just needed to clear cache.
Thank you again for your help!

1 Like