将cakephp从localhost传输到在线时出错(在线服务器是centos) [英] Error on transferring cakephp from localhost to online (online server is centos )
问题描述
我在开发后使用xampp在Windows中安装了CakePHP 2.6.2我在线转移然后服务器是centOS。然后显示一些错误,即
警告:_ cake_core_ cache无法在/var/www/hamdard.com/public/html中将'cake_dev_en-us'写入文件缓存第328行/hamdard/lib/Cake/Cache/Cache.php
警告:/var/www/hamdard.com/public/html/hamdard/app/ tmp / cache / persistent /在第385行的/var/www/hamdard.com/public/html/hamdard/lib/Cake/Cache/Engine/FileEngine.php中无法写入
致命错误:没有正确配置消息'Cache engine_ cake_core_的未捕获异常'CacheException'。确保在/var/www/hamdard.com/public/html/hamdard/lib/Cake/Cache/Cache.php:186中安装了所需的扩展,并且凭据/权限是正确的。堆栈跟踪:#0 / var / www / hamdard.com/public/html/hamdard/lib/Cake/Cache/Cache.php(151):Cache :: _ buildEngine('_ cake_core_')#1 /var/www/hamdard.com/public/html/hamdard/app /Config/core.php(374):Cache :: config('_ cake_core_',Array)#2 /var/www/hamdard.com/public/html/hamdard/lib/Cake/Core/Configure.php(72) :include('/ var / www / hamdar ...')#3 /var/www/hamdard.com/public/html/hamdard/lib/Cake/bootstrap.php(431):Configure :: bootstrap(true) #4 /var/www/hamdard.com/public/html/hamdard/app/webroot/index.php(98):include('/ var / www / hamdar ...')#5 / var / www / hamdard .com / public / html / hamdard / index.php(41):require('/ var / www / hamdar ...')#6 {main}引自/var/www/hamdard.com/public/html/第186行的hamdard / lib / Cake / Cache / Cache.php
我的缓存配置(在core.php中)是:
$ engine =文件';
//在开发模式下,缓存应该很快到期。
$ duration ='+999 days';
if(Configure :: read('debug')> 0){
$ duration ='+ 10秒';
}
//每个应用程序的前缀在同一台服务器上使用不同的字符串,以避免Memcache和APC冲突。
$ prefix ='dox_';
/ **
*配置用于一般框架缓存的缓存。使用此配置存储路径信息,
* /
Cache :: config('_ cake_core_ ',数组(
'engine'=> $ engine,
'前缀'=> $前缀。'cake_core_',
'path'=> CACHE。'持久'.DS,
'serialize'=>($ engine ==='文件'),
'持续时间' => $ duration
));
/ **
*配置模型的缓存和数据源缓存。此缓存配置
*用于存储架构描述和连接中的表列表。
* /
Cache :: config('_ cake_model_ ',数组(
'engine'=> $ engine,
'前缀'=> $前缀。'cake_model_',
'path'=> CACHE。'models'。DS,
'serialize'=>($ engine ==='File'),
'持续时间' => $ duration
));
Cache :: config('quote_parameters',array(
'engine'=>'文件',
'前缀'=> $前缀,
'serialize'=>($ engine ==='文件'),
'持续时间'=>'+1周',
'概率'=> 100,
'path'=> CACHE。'quote_parameters' .DS,
'groups'=>数组('order')
));
Cache :: config('pace_codes' ,数组(
'engine'=>'文件',
'前缀'=> $ pre修复,
'序列化'=>($ engine ==='文件'),
'持续时间'=>'+1周',>
'概率'=> 100,
'path'=> CACHE。 'pace_codes'。 DS,
'groups'=>数组('订单')
));
我尝试过:
我试过更改tmp文件夹权限。但仍然没有用。
I've got CakePHP 2.6.2 installed in windows with xampp after development i am transferring this online then server is centOS . Then show some error i.e.
Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /var/www/hamdard.com/public/html/hamdard/lib/Cake/Cache/Cache.php on line 328
Warning: /var/www/hamdard.com/public/html/hamdard/app/tmp/cache/persistent/ is not writable in /var/www/hamdard.com/public/html/hamdard/lib/Cake/Cache/Engine/FileEngine.php on line 385
Fatal error: Uncaught exception 'CacheException' with message 'Cache engine "_cake_core_" is not properly configured. Ensure required extensions are installed, and credentials/permissions are correct' in /var/www/hamdard.com/public/html/hamdard/lib/Cake/Cache/Cache.php:186 Stack trace: #0 /var/www/hamdard.com/public/html/hamdard/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_') #1 /var/www/hamdard.com/public/html/hamdard/app/Config/core.php(374): Cache::config('_cake_core_', Array) #2 /var/www/hamdard.com/public/html/hamdard/lib/Cake/Core/Configure.php(72): include('/var/www/hamdar...') #3 /var/www/hamdard.com/public/html/hamdard/lib/Cake/bootstrap.php(431): Configure::bootstrap(true) #4 /var/www/hamdard.com/public/html/hamdard/app/webroot/index.php(98): include('/var/www/hamdar...') #5 /var/www/hamdard.com/public/html/hamdard/index.php(41): require('/var/www/hamdar...') #6 {main} thrown in /var/www/hamdard.com/public/html/hamdard/lib/Cake/Cache/Cache.php on line 186
My cache configuration (in core.php) is:
$engine = 'File';
// In development mode, caches should expire quickly.
$duration = '+999 days';
if (Configure::read('debug') > 0) {
$duration = '+10 seconds';
}
// Prefix each application on the same server with a different string, to avoid Memcache and APC conflicts.
$prefix = 'dox_';
/**
* 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
));
Cache::config('quote_parameters', array(
'engine' => 'File',
'prefix' => $prefix,
'serialize' => ($engine === 'File'),
'duration' => '+1 week',
'probability' => 100,
'path' => CACHE . 'quote_parameters' . DS,
'groups' => array('order')
));
Cache::config('pace_codes', array(
'engine' => 'File',
'prefix' => $prefix,
'serialize' => ($engine === 'File'),
'duration' => '+1 week',
'probability' => 100,
'path' => CACHE . 'pace_codes' . DS,
'groups' => array('order')
));
What I have tried:
I have tried change the tmp folder permission. but still its not working.
推荐答案
engine ='File';
//在开发模式下,缓存应该很快到期。
engine = 'File';
// In development mode, caches should expire quickly.
duration ='+999 days';
if(Configure :: read('debug')> 0){
duration = '+999 days';
if (Configure::read('debug') > 0) {
duration ='+ 10秒';
}
//使用不同的字符串在同一服务器上添加每个应用程序,以避免Memcache和APC冲突。
duration = '+10 seconds';
}
// Prefix each application on the same server with a different string, to avoid Memcache and APC conflicts.
这篇关于将cakephp从localhost传输到在线时出错(在线服务器是centos)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!