Symfony 2.1 - %kernel.debug% does not exist

378 views Asked by At

I've inherited an old Symfony 2.1 project and having issues getting it up and running - I don't really have the time or budget to go through and upgrade it to something a bit more modern.

When trying to run php app/console I get the following error message:

[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]  
      The service definition "kernel.debug" does not exist.

I've been going round in circles trying to find the cause but can't seem to resolve it - any pointers or help would be great.

2

There are 2 answers

1
Oscar Manuel Gómez Senovilla On

Try grep -r 'kernel.debug' app/ to locate where it's being used. Make sure that the provided code was working with a supplied vendor/ directory, or you have the result of running composer install nowadays. You can even rename the vendor/ directory (as a kind of quick backup, regardless any other you may have) and run composer install to get rid of other possible inconsistencies.

0
James Amner On

Turns out it was a large amount of incompatible packages in my composer.json - some of the original packages were looking for alpha and dev builds as the project was cutting edge, 5 years ago. Now pulling alphas and betas broke loads of things. Went through npm to build a set of compatible packages from what I had and it worked.