How to enable debug mode in Symfony?

by cortez.connelly , in category: PHP Frameworks , a year ago

How to enable debug mode in Symfony?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer


by lew , 5 months ago


To enable debug mode in a Symfony application, you can use the following steps:

  1. Open the app.php or app_dev.php file in the web directory of your Symfony application.
  2. Find the following line of code:
$kernel = new AppKernel('prod', false);

  1. Replace prod with dev and false with true, so that the line of code looks like this:
$kernel = new AppKernel('dev', true);

This will enable debug mode for your application.

Note: If you are using the app.php file, you will need to manually clear the cache after making this change. You can do this by running the php bin/console cache:clear command.