How to Debug the Service Container & List ServicesEdit this page
Warning: You are browsing the documentation for Symfony 4.0, which is no longer maintained.
Read the updated version of this page for Symfony 6.2 (the current stable version).
You can find out what services are registered with the container using the console. To show all services and the class for each service, run:
$ php bin/console debug:container
By default, only public services are shown, but you can also view private services:
$ php bin/console debug:container --show-private
To see a list of all of the available types that can be used for autowiring, run:
$ php bin/console debug:autowiring
You can get more detailed information about a particular service by specifying its id:
1 2 3 4
$ php bin/console debug:container 'App\Service\Mailer' # to show the service arguments: $ php bin/console debug:container 'App\Service\Mailer' --show-arguments