CakePHP的部署遇到的 CacheException报错问题

由于开发中需要搭建本地环境,在windows用vmware搭建了一个基于centos7.3的LAMP环境。
当将cakephp开发框架部署到html目录后,运行就直接报错了。

报错代码如下:

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. 
In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. 
We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.in /var/www/html/cakephp/lib/Cake/Cache/CacheEngine.php on line 60
Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /var/www/html/cakephp/lib/Cake/Cache/Cache.php on line 323
Warning: /var/www/html/cakephp/app/tmp/cache/persistent/ is not writable in /var/www/html/cakephp/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 /var/www/html/cakephp/lib/Cake/Cache/Cache.php:181 Stack trace: #0 /var/www/html/cakephp/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_') #1 

看这段报错提示大概的意思就是我cache目录下的相关文件夹没有写入权限,但实际上相应的权限我肯定是给了的,那问题出在哪呢?
接着就是各种百度查询,这其中山路十八弯…
好了,最终发现是selinux的问题!
首先我们需要检查一下selinux是否开启
键入命令:

/usr/sbin/sestatus -v   

如果SELinux status参数为enabled即为开启状态
开启了那就关闭它!

vi /etc/selinux/config   

SELINUX=enforcing  

改为

SELINUX=disabled

ok,wq保存退出
接着重启服务器

shutdown -r now

接下来就不会报错了,并且能够看到欢迎页面了
由于自己的疏忽,忘了selinux的存在
希望能够帮到存在同样问题的你!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值