Learning: Debugging

PHP

You should turn on the display_errors directive and set error_reporting to E_ALL.

References

If you are crashing PHP, you may be exceeding certain internal limitations or known issues. It is known that eZ publish can encounter these 'reference' related problems.

Xdebug

Xdebug is an advanced debugging package for php. With Xdebug you can use it to obtain advanced information regarding your eZ publish runtime errors, problems or crashes. Many eZ systems senior developers rely on Xdebug to solve day to day eZ publish breakdowns which might cause a customer or user to request support.

Debug output

Enable the eZ publish debug output. If you're working with templates and template overrides you should also make eZ publish show a list of the used templates. You can easily find where the output of certain templates starts and stops with the ShowXHTMLCode setting.

Private debugging

You can selectively turn on the debug output for sites in production, so other visitors don't see it.

By IP

You can turn on the debug output only for certain client IP addresses.

By user ID

This feature is available since eZ publish 3.9.

You can turn on the debug output only for certain user accounts. Add this to your site.ini.append.php:

[DebugSettings]
DebugByUser=enabled
 DebugUserIDList[]
 DebugUserIDList[]=23
 DebugUserIDList[]=42

Now only users with the user/object ID 23 and 42 will see debug output.

Caching

It's recommended that you disable template compilation, the template block cache and the content view cache. You can add the following settings to site.ini.append.php to add aditional toggles for these caches to the quick settings tool:

[DebugSettings]
QuickSettingsList[]=TemplateSettings;TemplateCompile;site.ini;Templace compile
QuickSettingsList[]=TemplateSettings;TemplateCache;site.ini;Templace cache
QuickSettingsList[]=ContentSettings;ViewCaching;site.ini;View cache

Template

You may use a template operator called 'attribute' to display the contents of a variable or data structure.

More information on this operator can be found in the node, 'Learning: Template Debugging'.

{ $foo | attribute( show, 2 ) }

Related extensions

External resources