Switching the Profiler Storage

Version: 2.8
Edit this page

Warning: You are browsing the documentation for Symfony 2.8, which is no longer maintained.

Read the updated version of this page for Symfony 5.3 (the current stable version).

Switching the Profiler Storage

By default the profile stores the collected data in files in the %kernel.cache_dir%/profiler/ directory. You can control the storage being used through the dsn, username, password and lifetime options. For example, the following configuration uses MySQL as the storage for the profiler with a lifetime of one hour:

  • YAML
  • XML
  • PHP
1
2
3
4
5
6
7
# app/config/config.yml
framework:
    profiler:
        dsn:      'mysql:host=localhost;dbname=%database_name%'
        username: '%database_user%'
        password: '%database_password%'
        lifetime: 3600

The HttpKernel component currently supports the following profiler storage drivers:

  • file
  • sqlite
  • mysql
  • mongodb
  • memcache
  • memcached
  • redis
This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.