【问题标题】:CakePHP cache was unable to write in Centos 7CakePHP 缓存无法在 Centos 7 中写入
【发布时间】:2015-05-23 12:03:29
【问题描述】:

我尝试了所有想到的东西。我有一个标准错误:

Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /var/www/html/symulacje/inz.com/public_html/lib/Cake/Cache/Cache.php on line 328

Warning: /var/www/html/symulacje/inz.com/public_html/app/tmp/cache/persistent/ is not writable in /var/www/html/symulacje/inz.com/public_html/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/symulacje/inz.com/public_html/lib/Cake/Cache/Cache.php:186 Stack trace: #0 /var/www/html/symulacje/inz.com/public_html/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_') #1 /var/www/html/symulacje/inz.com/public_html/app/Config/core.php(374): Cache::config('_cake_core_', Array) #2 /var/www/html/symulacje/inz.com/public_html/lib/Cake/Core/Configure.php(72): include('/var/www/html/s...') #3 /var/www/html/symulacje/inz.com/public_html/lib/Cake/bootstrap.php(175): Configure::bootstrap(true) #4 /var/www/html/symulacje/inz.com/public_html/app/webroot/index.php(104): include('/var/www/html/s...') #5 /var/www/html/symulacje/inz.com/public_html/index.php(41): require('/var/www/html/s...') #6 {main} thrown in /var/www/html/symulacje/inz.com/public_html/lib/Cake/Cache/Cache.php on line 186

应用程序 775 的 Chmod:

drwxrwxr-x. 14 apache apache 4096 05-23 10:36 .
drwxrwxr-x.  8 apache apache 4096 05-23 10:36 ..
drwxrwxr-x.  3 apache apache 4096 05-23 11:43 Config
drwxrwxr-x. 16 apache apache 4096 05-23 10:36 Console
drwxrwxr-x.  3 apache apache 4096 05-23 10:36 Controller
-rwxrwxr-x.  1 apache apache  140 05-23 10:36 .htaccess
-rwxrwxr-x.  1 apache apache  689 05-23 10:36 index.php
drwxrwxr-x.  2 apache apache   34 05-23 10:36 Lib
drwxrwxr-x.  3 apache apache   16 05-23 10:36 Locale
drwxrwxr-x.  4 apache apache 4096 05-23 10:36 Model
drwxrwxr-x.  2 apache apache   18 05-23 10:36 Plugin
drwxrwxr-x.  4 apache apache   31 05-23 10:36 Test
drwxrwxr-x.  7 apache apache   68 05-23 10:36 tmp
drwxrwxr-x.  2 apache apache   18 05-23 10:36 Vendor
drwxrwxr-x. 12 apache apache 4096 05-23 10:36 View
drwxrwxr-x.  9 apache apache 4096 05-23 11:26 webroot

和 tmp/cache/777:

drwxrwxrwx. 4 apache apache 36 05-23 10:36 .
drwxrwxrwx. 7 apache apache 68 05-23 10:36 ..
drwxrwxrwx. 2 apache apache  6 05-23 11:16 models
drwxrwxrwx. 2 apache apache  6 05-23 11:16 persistent

我不知道我哪里有问题。

【问题讨论】:

  • 你使用的是什么版本的 CakePHP?
  • 我使用的是 CakePHP v2.6.1
  • 能否将app/Config/core.php 文件中的Cache::config('_cake_core_' 位包含在问题中?

标签: php apache cakephp permissions centos7


【解决方案1】:

好的,这对我有帮助:

setsebool -P httpd_unified 1

把它放在控制台

【讨论】:

    【解决方案2】:

    sudo chmod -R 777 tmp 一直为我工作,一旦在 app 文件夹中 bash

    【讨论】:

      【解决方案3】:

      除了检查文件/文件夹的所有权和权限,检查您是否正确配置了SELinux。在我的本地环境中,我更喜欢完全关闭它。

      setenforce 0
      

      【讨论】:

        猜你喜欢
        • 2016-11-28
        • 2013-08-15
        • 1970-01-01
        • 2011-11-26
        • 1970-01-01
        • 2014-08-03
        • 1970-01-01
        • 1970-01-01
        • 2016-09-28
        相关资源
        最近更新 更多