I am a previous CakePHP 2 user and am starting a new application using CakePHP3, I have searched but am finding very little examples and/or detailed instructions on the configuration of Memcached for my application.
In CakePHP 2 I simply created a Cache configuration like:
However I receive “Cache engine Cake\Cache\Engine\MemcachedEngine is not properly configured.” error which tells me almost nothing on what needs to be adjusted. I am sure this is a simple configuration / syntax issue on my part, however, I am unable to find a full working example or description on how to get memcached usable in CakePHP 3.
I know Memcached is installed correctly and running as all of my CakePHP 2 applications are using it just fine.
I have update my code to the lastest cakephp 3 in my app.php but still not working. I installed memcache and memcached in my centos server. Cakephp 2 its working fine but in cakephp 3 its not working throws error Cache engine Cake\Cache\Engine\MemcachedEngine is not properly configured.
'Cache' => [
'default' => [
'className' => 'Cake\Cache\Engine\MemcachedEngine',
],
/**
* Configure the cache used for general framework caching.
* Translation cache files are stored with this configuration.
* Duration will be set to '+2 minutes' in bootstrap.php when debug = true
* If you set 'className' => 'Null' core cache will be disabled.
*/
'_cake_core_' => [
'className' => 'File',
'prefix' => 'myapp_cake_core_',
'path' => CACHE . 'persistent/',
'serialize' => true,
'duration' => '+1 years',
'url' => env('CACHE_CAKECORE_URL', null),
],
/**
* Configure the cache for model and datasource caches. This cache
* configuration is used to store schema descriptions, and table listings
* in connections.
* Duration will be set to '+2 minutes' in bootstrap.php when debug = true
*/
'_cake_model_' => [
'className' => 'File',
'prefix' => 'myapp_cake_model_',
'path' => CACHE . 'models/',
'serialize' => true,
'duration' => '+1 years',
'url' => env('CACHE_CAKEMODEL_URL', null),
],
],
So, the reasons that memcached will throw that error are:
The memcached php extension is not installed (Be careful here, Cake 2.x could use the old memcache extension, it’s possible you don’t have the correct one installed)
I see this error Warning (512): Cache engine Cake\Cache\Engine\MemcachedEngine is not properly configured. in [/home/apidata/public_html/vendor/cakephp/cakephp/src/Cache/Cache.php, line 177]