2

Yii2 documentation suggests the following configuration which is applicable for memCache.

    'components' => [
    'cache' => [
        'class' => 'yii\caching\MemCache',
        'servers' => [
            [
                'host' => 'server1',
                'port' => 11211,
                'weight' => 100,
            ],

        ],
    ],
 ]
  1. How can i configure the component to use op_cache?
  2. Where can i find the 'host','port','weight' information on a local WAMP server?

Thanks

Thiyaga Raj
  • 105
  • 3
  • 12

1 Answers1

2

The goal of Opcache is not to store data, you cannot use it as a Yii2 data caching component :

OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.

You should read this : Supported Cache Storage in Yii2.

soju
  • 25,111
  • 3
  • 68
  • 70
  • 1
    Thanks Soju. I want to use php_apc cache in my Yii2 app but my php is 5.5+ so i can't use it. What could be the alternative way i can use php_apc or similar ? Thanks – Thiyaga Raj Sep 12 '16 at 10:03