CakePHP缓存无法在Centos 7中编写

Ska*_*nik 2 php apache permissions cakephp 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
Run Code Online (Sandbox Code Playgroud)

还有这个:

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
Run Code Online (Sandbox Code Playgroud)

应用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
Run Code Online (Sandbox Code Playgroud)

和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
Run Code Online (Sandbox Code Playgroud)

我不知道我有什么问题.

Ska*_*nik 9

好的,这对我有所帮助:

setsebool -P httpd_unified 1
Run Code Online (Sandbox Code Playgroud)

把它放在控制台中