Skazmierz Ogrodnik
Skazmierz Ogrodnik

Reputation: 147

CakePHP cache was unable to write in Centos 7

I tried everything that came to mind. I have a standard error:

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

And this:

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

Chmod for app 775:

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

and 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

I don't know where i have problem.

Upvotes: 2

Views: 3490

Answers (3)

gdm
gdm

Reputation: 7910

Beside checking file/folder ownership and permissions, check if you have SELinux properly configured. In my local env, I prefer to switch it off commpletely.

setenforce 0

Upvotes: 0

Colonel Mustard
Colonel Mustard

Reputation: 1533

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

Upvotes: 0

Skazmierz Ogrodnik
Skazmierz Ogrodnik

Reputation: 147

Okay, this helped me:

setsebool -P httpd_unified 1

put this in console

Upvotes: 9

Related Questions