Symfony2 error: The service "templating" has a dependency on a non-existent service "templating.globals" Symfony2 error: The service "templating" has a dependency on a non-existent service "templating.globals" symfony symfony

Symfony2 error: The service "templating" has a dependency on a non-existent service "templating.globals"


The templating.globals service is only created by the symfony/framework-bundle if you have php in the list on templating engines.

As you can see in the Resources/config/templating_php.xml the service is created.

This file is only loaded in the extension if php is in the list of templating engines.

TL;DR Add php to the templating engines in your app/config/config.yml.

# app/config/config.ymlframework:    # ...    templating:        engines: ['twig', 'php']


If you are running Symfony 4.x then You've to add the following to the config/packages/framework.yaml:

framework:    # ... other stuff ...    templating:        engines: ['twig', 'php']