Fix “Cannot redeclare class Symfony\…” in Symfony2 after upgrade

After upgrading from Symfony 2.2 to 2.3 I got this error in my application:

Fatal error: Cannot redeclare class Symfony\Component\HttpFoundation\FileBag in app/cache/prod/classes.php on line 1823

Another symptom was this error while trying to clear the cache for the prod environment:

[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
The parameter "kernel.http_method_override" must be defined.

The process to solve this problem was:

1.- Remove the cache folder:

rm -rf app/cache/prod

2.- Then clear the cache for the prod environment:

php app/console cache:clear --env=prod --no-debug

Ref:

You might also like

Symfony2 – ErrorException: Notice: serialize() [function.serialize]: “xxx” returned as member variable from __sleep() but does not exist in …
While storing an entity from Doctrine2 in the session under a Symfony2 application I got this error: ErrorException:...
Fix “Fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes)” with composer update
I got this error today when running composer update for one of my Symfony2 projects: Fatal error:...
Expose config.yml values globally for Twig templates in Symfony2 applications
Lets suppose you have created a bundle that has some specific configuration in the config.yml file (this...
Install a Symfony2 application using Composer
Before installing any Symfony2 project you have to meet the minimum requirements for it in your server....
Leave a comment ?

0 Comments.

Leave a Comment