Search code examples
symfonyprofilerproductionmode

How can I turn on the profiler in production mode (Symfony)?


I have a strange error. My Symfony app works fine in dev mode. But in production mode I am not able to save any files. So I need to turn on the profiler in production mode for a second to see what is the error. How can I achieve this?


Solution

  • Symfony profiler shouldn’t be in prod mode. Symfony docs : "Never enable the profiler in production environments as it will lead to major security vulnerabilities in your project."

    You need to focus on your logs server. But if you want to do this.

    1. Create a web_profiler.yaml (.../config/packages/prod)

    2. Insert this content :

      web_profiler:
        toolbar: true
        intercept_redirects: false
      
      framework:
        profiler: { only_exceptions: false }
      
    3. Remove this after your found your problem

    Regards