CodeIgniter Forums
Cache unable to write to /cache/. - Printable Version

+- CodeIgniter Forums (
+-- Forum: Using CodeIgniter (
+--- Forum: Installation & Setup (
+--- Thread: Cache unable to write to /cache/. (/showthread.php?tid=82671)

Cache unable to write to /cache/. - notme - 08-06-2022

I just set up a new instance of CodeIgniter. Unfortunately I get the following error "Cache unable to write to /cache/.". For some reason, CodeIgniter has a need to cache write to /cache among other system folders, not in web folder. If I create a folder, I get an error that mkdir cannot be executed. CodeIgniter is running under www-data:www-data.
For some reason constant WRITEPATH is "/".

PHP - 8.1.8

Do you have any idea how fix?
Thank you

[Image: B5rIkdK.png]

[Image: ANMnEF3.png]

RE: Cache unable to write to /cache/. - captain-sensible - 08-08-2022

so your obviously using linux looking at /var/www

inside the main folder of your web app there are directories eg app, writable

inside writable there is a cache directory.

From a terminal emulator cd into main web root .

I just did mine like this: sudo chmod 777 writable -R

my understanding is that you need to have execute permission on a directory in order for the 'system' to be able to enter the directory in question.
-R is recursive so it should make cache directory also read, write, execute

so your using apache on which linux distro ?

i dont know of this is going to help but on my linux this is my structure. CodeIgniter4 is contained within a directory called
[andrew@darkstar:/srv/http]$ tree -L 1                                                               (08-08 16:28)
├── 1.png
├── app
├── bootstrapCss
├── bootstrapS
├── builds
├── composer.json
├── composer.lock
├── env
├── fontawesome
├── Gruntfile.js
├── Gruntfile.js.bk
├── gulpfile.js
├── license.txt
├── node_modules
├── package.json
├── package-lock.json
├── PHPMailer
├── phpunit.xml.dist
├── public
├── scss
├── spark
├── tecnickcom
├── tests
├── vendor
└── writable

i find it easier to use virtual host config

RE: Cache unable to write to /cache/. - notme - 08-08-2022

Quote:I just did mine like this: sudo chmod 777 writable -R

Yes, I missed it. Problem solved. Thank you.