8000 Cannot redeclare ContainerAwareInterface in classes.php · Issue #23016 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

Cannot redeclare ContainerAwareInterface in classes.php #23016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MassiveHiggsField opened this issue Jun 1, 2017 · 3 comments
Closed

Cannot redeclare ContainerAwareInterface in classes.php #23016

MassiveHiggsField opened this issue Jun 1, 2017 · 3 comments

Comments

@MassiveHiggsField
Copy link
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.0

After upgrading from Symfony 3.0.6 to 3.3.0 something with the cache seems to be broken in production mode. There are some other tickets basically mentioning the same issue, but the solution was always to remove the offending class from src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Similar issues/pull requests:

#22657
#20753
#21520

and some more, just search for redeclare in the issues.

My problem specifically concerns the ContainerAwareInterface, the error message is:

PHP message: PHP Fatal error: Cannot redeclare class Symfony\Component\DependencyInjection\ContainerAwareInterface in var/cache/dhs/prod/classes.php on line 3364

At first i tried the usual, cache clearing (via rm and app/console), vendor reinstalls (even removing the complete vendor directory).

I just removed the class from the list in FrameworkExtension.php, cleared the cache and everything works fine so far. Is there a bigger problem with this new caching mechanism or is it my environment?

@sstok
Copy link
Contributor
sstok commented Jun 4, 2017

Are you using opcache? try clearing this.

For now you can remove this line https://github.com/symfony/symfony-standard/blob/3.3/web/app_dev.php#L27 (it may negatively effect performance if you're not using PHP 7).

@MassiveHiggsField
Copy link
Author

OpCode Cache clearing didn't solve it unfortunately, removing the line of course does. For now, this is okay, since we're in the process of finally moving to php7, so this may not be an issue then.

@nicolas-grekas
Copy link
Member

This caching mechanism is fragile. Not using it is the proper fix. (And moving to php7 :))
Closing as this is already deprecated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0