eZ Publish - Notes & tips

mail

eZ Publish file tree

[wwwRoot] the document root
settings
override override settings defined in site.ini for all 'siteaccesses'
site.ini.append.php
[DatabaseSettings] db host + name + credentials
[Session]
Handler= void (=ezpSessionHandlerPHP) : PHP handles sessions (Details : vim +/Session /etc/php5/apache2/php.ini) ezpSessionHandlerDB : eZ Publish does.
site.ini
[DatabaseSettings]
QueryAnalysisOutput enable/disable SQL errors (?)
SQLOutput enable/disable SQL errors (?)
[DebugSettings]
DebugOutput enable/disable output of debug messages into debug.log
AlwaysLog[] Array defining content to output as debug
[FileSettings]
LogDir=log name of the log dir, it's a subdir of VarDir (source)
TemporaryDir=/tmp (explicit). out of space errors may also be due to insufficient disk space on the DB server's temp. filesystem
var
autoload
cache cache for ALL sites handled by eZ (all siteaccesses). Contain ini, rights, ... Generated by CLI.
log
debug.log exists only when enabled in settings/site.ini
error.log
siteaccess stuff dedicated to the siteaccess instance
cache siteaccess-specific cache. Contains views, templates, ... Generated upon browsing the site.
log
storage content uploaded from the BO on the siteaccess instance. Can be symlinked to, to "share" a var/ directory
storage content uploaded from the BO on the generic instance. Can be symlinked to, to "share" a var/ directory
mail

eZ Publish : clear caches

From BO OR FO (doesn't matter as long as cache files are accessible) :

  1. Go to the root of the eZ website : cd /var/www/www.example.com
  2. list the available cache flavors :
    • php bin/php/ezcache.php --list-tags
    • php bin/php/ezcache.php --list-ids
  3. choose from :
    • clear all caches having the specified tag :
      • php bin/php/ezcache.php --clear-tag=ini
      • php bin/php/ezcache.php --clear-tag=template
    • clear the specified cache only :
      • php bin/php/ezcache.php --clear-id=template
      • php bin/php/ezcache.php --clear-id=ini
      • php bin/php/ezcache.php --clear-id=template,ini
    • clear the specified node only : php bin/php/ezcontentcache.php --clear-node=239999
    • clear ALL CACHES (when a major change occurred on eZ Publish : fresh install, upgrade, ...) : php bin/php/ezcache.php --clear-all
    • After pushing to prod : for cache in ini template content; do php bin/php/ezcache.php --clear-id="$cache"; done

The --clear-tag command deletes more caches than --clear-id, use it carefully

Need help ? php bin/php/ezcache.php -h

Selective cache cleanup

Purge caches :

There are 2 methods to proceed :

The official slow method :

php bin/php/ezcache.php --clear-all --purge
This works fine, but it is VERY long since it queries the database for details on each cached content before effectively deleting it.

The QnD method :

  1. mv var/cache var/cache_OLD; mkdir var/cache
  2. mv var/siteaccess/cache var/siteaccess/cache_OLD; mkdir var/siteaccess/cache
  3. php bin/php/ezcache.php --clear-all
  4. rm -r var/cache_OLD var/siteaccess/cache_OLD