Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dragonofmercy's avatar

Cache and storage directories not created if not exists

Hello, I have a little question about cache and storage directories, why the framework don't create automaticaly the missing directories, for example when I first deploy my app with rsync, the cache directory in the bootstrap folder don't exist, just like the framework directories in storage folder.

At the end of the composer update an exception is throwing with the message that the cache directory is not writable, same with the sessions or the view directory.

I think this can be automated by the framework, what did you think?

0 likes
2 replies
JussiMannisto's avatar

All of those directories already exist in a default Laravel project. If you use rsync to push your code, then you need to use better patterns so that the directories used by the framework don't get excluded.

Most developers deploy their code from a source code hosting facility such as GitHub, so they never have this problem.

Snapey's avatar

Definately ditch rsync and deploy from version control.

By default these folders include .gitignore files. These are added to make sure the empty folder is created - don't delete these

Please or to participate in this conversation.