H
H
hollanditkzn2017-07-12 10:27:51
Yii
hollanditkzn, 2017-07-12 10:27:51

How to enable rbac caching?

I tried to use this example https://habrahabr.ru/post/251847/ rbac caching
But I got it after this common/config/main.php code

'components' => [
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'cacheRbac' => [
            'class' => 'yii\caching\ApcCache',
        ]
    ],

common/config/main-local.php
return => [
'components' => [
'authManager' => [
            'class' => 'yii\rbac\DbManager',
            'cache' => 'cacheRbac',
        ],
}
]

And writes the problem ApcCache requires PHP apc extension to be loaded.
As I understand it, this extension is not there and the second moment is how to download it.
I have already visited the site www.php.net/apc, I need to install something as I understand it, and the second point is how to transfer it to the hosting?
And my php version is 5.6

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-07-12
@hollanditkzn

1. Here is Apc installation guide: sitear.ru/material/apc-php
2. It is not necessary to use apc for rbac, it will work with other types of cache. Choose:
More details here: www.yiiframework.com/doc-2.0/guide-caching-data.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question