CakePHP缓存无法在Centos 7中编写

时间:2015-05-23 12:03:30

标签: php apache cakephp permissions centos7

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

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

我不知道我有什么问题。

3 个答案:

答案 0 :(得分:9)

好的,这对我有所帮助:

setsebool -P httpd_unified 1

把它放在控制台

答案 1 :(得分:0)

sudo chmod -R 777 tmp always worked for me, once bash in the app folder

答案 2 :(得分:0)

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

setenforce 0