cakephpcachingcakephp-3.2

RuntimeException : Cake\Cache\Engine\FileEngine is not properly configured in CakePHP 3


I have written an application in CakePHP 3.2 and recently uploaded to a dedicated server.

But this is giving RuntimeException error as

Cache engine Cake\Cache\Engine\FileEngine is not properly configured.

Warning: file_put_contents(/var/www/html/logs/error.log) 
[function.file-put-contents]: failed to open stream: Permission denied in
/var/www/html/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 134

I tried with changing permission of logs and tmp directory to 777 (including sub directories) but this doesn't solve the issue.

output of ls -la

drwxr-xr-x. 13 root   root    4096 Oct 22 02:39 .
drwxr-xr-x.  4 root   root      43 Oct 12 20:12 ..
drwxr-xr-x.  2 root   root      63 Oct 21 15:08 bin
-rw----r--.  1 root   root    1499 Oct 21 15:08 composer.json
-rw----r--.  1 root   root   48701 Oct 21 15:08 composer.lock
drwxr-xr-x.  3 root   root    4096 Oct 21 15:08 config
-rw----r--.  1 root   root     329 Oct 21 15:08 .editorconfig
-rw----r--.  1 root   root     772 Oct 21 15:08 .gitattributes
-rw----r--.  1 root   root      41 Oct 21 15:08 .gitignore
-rw----r--.  1 root   root     159 Oct 22 03:02 .htaccess
-rw----r--.  1 root   root     648 Oct 21 15:08 index.php
-rw-r--r--.  1 apache apache    20 Oct 13 00:10 info.php
drwxrwxrwx.  2 root   root      46 Oct 22 02:30 logs
drwxr-xr-x.  2 root   root      10 Oct 21 15:08 mobile_scripts
-rw----r--.  1 root   root    1202 Oct 21 15:08 phpunit.xml.dist
drwxr-xr-x.  3 root   root      37 Oct 21 15:08 plugins
-rw----r--.  1 root   root    1015 Oct 21 15:08 README.md
drwxr-xr-x.  8 root   root    4096 Oct 21 15:13 src
drwxr-xr-x.  4 root   root      71 Oct 21 15:13 tests
drwxrwxrwx.  6 root   root      76 Oct 21 15:13 tmp
-rw----r--.  1 root   root     321 Oct 21 15:08 .travis.yml
drwxr-xr-x. 21 root   root    4096 Oct 21 15:14 vendor
drwxr-xr-x.  5 root   root    4096 Oct 21 15:24 webroot

What could be the cause and how to resolve it ?


Solution

  • I got it working. For someone if get stuck with this error can try this solution.

    I am using centOS Server

    disabling SELinux worked for me.