我有工作的 CakePHP2.5.dev
应用程序,我cache
在 CakePHP 中通过
Configure::write('debug', 2);
Configure::write("Cache.disable", true);
在app/Config/core.php
不幸的是,我必须将此应用程序部署到无法写入app/tmp
目录的服务器上。
我检查了 StackOverflow 上的答案,如何禁用缓存和上面的行app/Config/core.php
,甚至注释掉负责缓存的其余行,即
/**
* Configure the cache used for general framework caching. Path information,
* object listings, and translation cache files are stored with this configuration.
*/
//Cache::config('_cake_core_', array(
// 'engine' => $engine,
// 'prefix' => $prefix . 'cake_core_',
// 'path' => CACHE . 'persistent' . DS,
// 'serialize' => ($engine === 'File'),
// 'duration' => $duration
//));
/**
* Configure the cache for model and datasource caches. This cache configuration
* is used to store schema descriptions, and table listings in connections.
*/
//Cache::config('_cake_model_', array(
// 'engine' => $engine,
// 'prefix' => $prefix . 'cake_model_',
// 'path' => CACHE . 'models' . DS,
// 'serialize' => ($engine === 'File'),
// 'duration' => $duration
//));
但是当我在生产服务器上运行我的应用程序时,我得到了一个异常。
Warning: /home/kowalski_m/public_html/projekt2/app/tmp/cache/persistent/ is not writable in /home/kowalski_m/public_html/projekt2/lib/Cake/Cache/Engine/FileEngine.php on line 384
Fatal error: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /home/kowalski_m/public_html/projekt2/lib/Cake/Cache/Cache.php:181 Stack trace: #0 /home/kowalski_m/public_html/projekt2/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_') #1 /home/kowalski_m/public_html/projekt2/app/Config/core.php(376): Cache::config('_cake_core_', Array) #2 /home/kowalski_m/public_html/projekt2/lib/Cake/Core/Configure.php(72): include('/home/kowalski_...') #3 /home/kowalski_m/public_html/projekt2/lib/Cake/bootstrap.php(175): Configure::bootstrap(true) #4 /home/kowalski_m/public_html/projekt2/app/webroot/index.php(94): include('/home/kowalski_...') #5 /home/kowalski_m/public_html/projekt2/index.php(41): require('/home/kowalski_...') #6 {main} thrown in /home/kowalski_m/public_html/projekt2/lib/Cake/Cache/Cache.php on line 181
所以看起来缓存仍然有效。
我无法在此服务器中获得此目录的写入规则。我无权访问root。
如何完全禁用缓存并将 CakePHP 设置为不写入任何内容/app/tmp
?