加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

CakePHP错误:cake_core_ cache无法在Ubuntu 14.04上写’cake_de

发布时间:2020-12-13 17:50:25 所属栏目:PHP教程 来源:网络整理
导读:当我在localhost Ubuntu 14.04(LAMP)上运行我的Cake PHP应用程序时出现此错误: Warning: _cake_core_ cache was unable to write ‘cake_dev_en-us’ to File cache in /var/www/html/tmc/lib/Cake/Cache/Cache.php on line 328 Warning: /var/www/html/tmc
当我在localhost Ubuntu 14.04(LAMP)上运行我的Cake PHP应用程序时出现此错误:

Warning: _cake_core_ cache was unable to write ‘cake_dev_en-us’ to
File cache in /var/www/html/tmc/lib/Cake/Cache/Cache.php on line 328

Warning: /var/www/html/tmc/app/tmp/cache/persistent/ is not writable
in /var/www/html/tmc/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/html/tmc/lib/Cake/Cache/Cache.php:186 Stack trace: #0
/var/www/html/tmc/lib/Cake/Cache/Cache.php(151):
Cache::_buildEngine(‘_cake_core_’) #1
/var/www/html/tmc/app/Config/core.php(386):
Cache::config(‘_cake_core_’,Array) #2
/var/www/html/tmc/lib/Cake/Core/Configure.php(72):
include(‘/var/www/html/t…’) #3
/var/www/html/tmc/lib/Cake/bootstrap.php(431):
Configure::bootstrap(true) #4
/var/www/html/tmc/app/webroot/index.php(97):
include(‘/var/www/html/t…’) #5 {main} thrown in
/var/www/html/tmc/lib/Cake/Cache/Cache.php on line 186

我不知道问题出在哪里.我尝试了sudo chmod 775 /var/www/html/tmc/lib/Cake/Cache/Engine/FileEngine.php命令,但它没有解决问题.

解决方法

如果您正在以用户www-data运行apache或nginx(fast-cgi),那么用户应该是该文件的所有者:

cd /var/www/html/tmc/app;

find tmp -type d -print0 | xargs --no-run-if-empty -0 chmod 2755;
find tmp -type f -print0 | xargs --no-run-if-empty -0 chmod 0644;

chown -R www-data:www-data tmp;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读