By bricattaapps
Hi guys,
I am trying to setup memcache in Cakephp (2.5.3) on ubuntu 14.
Here’s what I have done :
Setup memcache (based on this https://www.digitalocean.com/community/tutorials/how-to-install-and-use-memcache-on-ubuntu-14-04 ). All is working fine (info.php, grep, service is running, etc).
Update cakephp ‘bootstrap.php’. Change
// Cache::config('default', array('engine' => 'File'));
Cache::config('default', array('engine' => 'Memcache'));
When i load my cakephp page, this error appears :
Cache engine default is not properly configured.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Changed in version 2.5: The Memcached engine was added. And the Memcache engine was deprecated.
Try using the “Memcached” engine instead:
Cache::config('default', array('engine' => 'Memcached'));
I tried to change it to ‘memcached’ in bootstrap.php
Cache::config('default', array('engine' => 'Memcached'));
Error :
Cache engine default is not available.
After that, I update core.php with this configuration below but got a fatal error.
Cache::config('default', array(
'engine' => 'Memcached', //[required]
'duration' => 3600, //[optional]
'probability' => 100, //[optional]
'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
'servers' => array(
'127.0.0.1:11211' // localhost, default port 11211
), //[optional]
'persistent' => 'my_connection', // [optional] The name of the persistent connection.
'compress' => false, // [optional] compress data in Memcached (slower, but uses less memory)
));
Error :
Fatal error: Uncaught exception 'CacheException' with message 'Cache engine default is not available.' in /var/www/html/my/lib/Cake/Cache/Cache.php:173 Stack trace: #0 /var/www/html/my/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('default') #1 /var/www/html/my/app/Config/core.php(410): Cache::config('default', Array) #2 /var/www/html/my/lib/Cake/Core/Configure.php(72): include('/var/www/html/m...') #3 /var/www/html/my/lib/Cake/bootstrap.php(175): Configure::bootstrap(true) #4 /var/www/html/my/app/webroot/index.php(90): include('/var/www/html/m...') #5 {main} thrown in /var/www/html/my/lib/Cake/Cache/Cache.php on line 173
Are there any settings in core.php ?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.