Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Directories under var/

What lives under var/ - the site's cache, storage and log, var/log, var/autoload - what may be deleted, what must be backed up, and where an extension keeps its own files.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/extension-development/part-8-reference/directories-under-var.md

On this page

Directories under var/

Part 8, reference 28. Everything an installation writes at run time is under var/. Knowing what is where tells you what a cache clear removes, what a backup must keep, and where your extension may write.

The layout

PathHoldsDelete?Back up?
var/<site>/the site's var directory (site.ini [FileSettings] VarDir, var by default, usually set to var/<site>); eZSys::varDirectory()
var/<site>/cache/compiled templates, view caches, settings caches, packed CSS and JS, everything a cache clear removes; eZSys::cacheDirectory()yes, through the cache commandsno
var/<site>/storage/uploaded files and images of content; eZSys::storageDirectory()neveryes
var/<site>/log/the site's log filesrotate, do not delete blindlyas policy requires
var/log/logs written before a site is known, and the default for eZLog::write()rotateas policy requires
var/autoload/generated autoload arrays of extensions and overrides (ezp_extension.php, ezp_override.php); the kernel's own is autoload/ezp_kernel.php at the rootregenerated by the autoload commandno

<site> is a name the installation chooses (often site). Some installations add their own folders; the kernel's own extensions may keep caches and job data in subfolders of the site's var directory.

Rules for an extension

  • Ask for the path: eZSys::varDirectory(), eZSys::cacheDirectory(), eZSys::storageDirectory(); never write var/site into code (eZSys and eZExtension).
  • Caches in cacheDirectory()/myext/: anything you can rebuild. A cache clear may delete it at any time.
  • Data in the database or storage: anything you cannot rebuild. Never keep the only copy of data in the cache.
  • Through the cluster file handler for files more than one request reads, so the extension works on clusters (eZFile, eZDir and cluster file handlers).
  • With the installation's permissions: eZDir::mkdir() and eZFile::create() use the configured file modes, so the web server and command line scripts can both read what the other wrote (File modes).
  • Nothing secret in var/ if it is web-readable. The web server configuration must not serve var/ except storage and the packed public files; do not rely on obscure file names.

Clearing by hand

Never delete inside var/ with rm to "clear caches": cluster setups keep a database record per file, and the next request may find a record without its file. Use php bin/php/ezcache.php or ./console exp:cache (Cache tags, cache blocks and clearing caches).

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x