-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Cannot redeclare class Acme in /path/to/Acme.php #25484
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
Comments
In the Symfony Demo repository we're also getting reports about similar issues: "Cannot declare class XXX because the name is already in use": symfony/demo#411 (comment) |
I got it sorted out once by removing the boostrap.cache file. I have to check if this is the cure, if it happens again. |
This issue is generally due to this: conflicting inlining strategies between |
How? I just upgrade from 3.3 to 3.4 and did all relevant upgrades from UPGRADE-3.4.md. There's nothing stated about those files? |
Ok... just killing the bootstrap file isn't the solution. Redoing all caches still falls back to the exception. btw: I'm currently pinned on PHP 5 and as far as I understand the app*.php files, dropping the bootstrap file is for PHP 7 only. |
v3.4.2 will embed a fix for this so that no action will be required anymore. See #25363 |
Okay, thanks! I'll got for setting |
Hi, did the container.dumper.inline_class_loader false, fixed the problem? Using Symfony 3.4.6 and keep getting the "cannot declare class Locale, because the name is already in use" /Symfony/Component/Intl/Resources/stubs/Locale.php:21 Thanks !!! |
Hello, in which file do you add this parameter ? |
I can confirm this finally helped me, thank you 👍
In your protected function build(ContainerBuilder $containerBuilder): void
{
$containerBuilder->setParameter('container.dumper.inline_class_loader', false);
} |
After upgrading to Symfony 3.4.1 I'm encountering strange caching issues.
In dev I get "Cannot redeclare class EventSubscriberInterface" with a fresh cache after the first successfull page load. In that case the first broken call is the web profiler on that exact page. Reloading the page directly runs into the FatalErrorException. I got it twice directly after executing a
doctine:migration:foo
command and once after switching branches or something like that.In prod I get (on my dev and another totally different machine) a "PHP Fatal error: Cannot redeclare class appProdProjectContainer in /var/www/conti.ido.software/git/devel/var/cache/prod/appProdProjectContainer.php on line 7519" on warming up the cache.
In dev I could fix it by randomly removing cache, clearing cache and writing
dump("foo")
into the EventSubscriberInterface file in no particular order. I found #21520 which sounds related.It's driving me nuts.
The text was updated successfully, but these errors were encountered: