CakePHP Custom CacheEngine and shell problems
I wrote my own cacheEngine for memcached as that's the extension I have installed on my server and not memcache, so I can't use the default memcache engine.
Now the engine is working fine when visiting 开发者_JAVA百科the website, however. When I try to start a shell I get all sorts of Cache::Config errors, that I don't see when visiting the site.
PHP Warning: Cache not configured properly. Please check Cache::config(); in APP/config/core.php in /home/ezra/sites/example.nl/cake/libs/configure.php on line 402
Warning: Cache not configured properly. Please check Cache::config(); in APP/config/core.php in /home/ezra/sites/example.nl/cake/libs/configure.php on line 402
PHP Notice: Undefined index: prefix in /home/ezra/sites/example.nl/cake/libs/configure.php on line 410
Notice: Undefined index: prefix in /home/ezra/sites/example.nl/cake/libs/configure.php on line 410
PHP Warning: /persistent/ is not writable in /home/ezra/sites/example.nl/cake/libs/cache/file.php on line 267
Warning: /persistent/ is not writable in /home/ezra/sites/example.nl/cake/libs/cache/file.php on line 267
PHP Warning: /models/ is not writable in /home/ezra/sites/example.nl/cake/libs/cache/file.php on line 267
Warning: /models/ is not writable in /home/ezra/sites/example.nl/cake/libs/cache/file.php on line 267
Welcome to CakePHP v1.3.10 Console
And my Cache::config in core.php
/*
Memcached (http://www.danga.com/memcached/)
*/
Cache::config('default', array(
'engine' => 'Memcached', //[required]
'duration'=> 3600, //[optional]
'probability'=> 100, //[optional]
'prefix' => 'smm_', //[optional] prefix every cache file with this string
'servers' => array(
array('127.0.0.1', 11211), // localhost, default port 11211
), //[optional]
'compress' => true, // [optional] compress data in Memcache (slower, but uses less memory)
'persistent' => false, // [optional] set this to false for non-persistent connections
));
Are there any bugs with Shells and custom cacheengines or did I really mess up?
TIA
Found the problem.
I had a different php.ini for cli, in this php.ini I forgot to load the memcached.so.
After adding this to the php.ini it worked fine!
精彩评论