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

Time:10-07

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?

CodePudding user response:

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

  • Related