Runtime folders

Which runtime folders can be cleared safely?

  • cache
  • debug
  • logs

Is there any documentation that discusses this. I tried searching but seem to be failing at finding relevant article.

I am pretty sure anything under runtime can be cleared.

2 Likes

I think I’ve seen problems with permissions of the recreated folders (e.g. debug).

What about clearing the sub-folders of their content, but leaving the directory structure in place?

What is the reason to clear it? Save space? I haven’t had issues as long as the web user or www-data in my instance can recreate the folder structure.

Originally, I was having an issue and was wondering if it was some type of caching issues, so I wanted to clear everything out to double check. That issue has since been resolved and now it is a general knowledge and curiosity to properly understand Yii2 folders/setup properly.

rm -rfv <your_app>/runtime/*

You should be good. If you are not sure , you can run chmod
chmod -R 777 <your_app>/runtime/

and you should be good

1 Like