O'Reilly logo

Magento 2 Developer's Guide by Branko Ajzele

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The var directory

Magento does a lot of caching and autogeneration of certain class types. These caches and generated classes are all located in Magento's root var directory. The usual contents of the var directory is as follows:

cache
composer_home
generation
log
di
view_preprocessed
page_cache

During development, we will most likely need to periodically clear these so that our changes can kick in.

We can issue the console command as follows to clear individual directories:

rm -rf {Magento root dir}/var/generation/*

Alternatively, we can use the built-in bin/magento console tool to trigger commands that will delete the proper directories for us, as follows:

  • bin/magento setup:upgrade: This updates the Magento database schema and data. While doing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required