In this chapter, a few insights, tips and tricks for debugging Pimcore are shown. This should give you a head start when developing with Pimcore.
In order to include some specific debugging tools (profiler, toolbar, ...), Pimcore relies on environment variable
.env file in your project root directory.
The development mode enables some debugging features. This is useful if you're developing on the core of Pimcore or when creating a bundle. Please don't activate it in production systems!
What exactly does the dev mode:
- Disables some caches (Cache, ...)
- extensive logging into log files
- ... and some more little things
Add the following line to your
.env file to enable dev mode.
For server side debugging, standard php and Symfony framework debugging tools like the following can be used.
- Reading log files as described here
- Using Symfony profiler console depending on the active environment. Details see Symfony docs
- Using Xdebug and a proper IDE for stepwise debugging, more information see Xdebug docs
Pimcore might add following headers to its responses to provide additional debug information, especially concerning full page cache:
If response is delivered directly from full page cache:
X-Pimcore-Output-Cache-Tag:output_<SOME_HASH>: Cache tag of delivered information.
X-Pimcore-Cache-Date:<CACHE_DATE>: Date when information was stored to cache.
If response could be delivered from full page cache, but is not:
X-Pimcore-Output-Cache-Disable-Reason:<SOME REASON>: Describes reason why response is not delivered directly from full page cache. Reasons can be
in debug mode,
backend user is logged in,
exclude path patter in system-settings matches,
exclude cookie in system-setings matches, etc.
One additional header to identify that response is sent by Pimcore.
X-Powered-By:pimcore: Added to every request.