-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[BUG] [Symfony 3.0] [PHP 7] Cannot declare class Locale, because the name is already in use #20532
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
This looks weird. Can you explain which step you performed that ended up here? Did you switch PHP versions, but did not clear the cache? |
First I upgraded to 3.0.1, after a succesful upgrade, i switched to PHP 7.0. I can confirm this issue is not a cache issue. I forced cleared the cache by removing the folder cache content (rm ./var/cache/prod/; rm ./var/cache/dev/), but that does not solve anything. |
I got the issue! The following rule causes the error: I replaced the code with the following code: But this strange (Declare) error should not may appear! |
Same here with Symfony 3.2, PHP 7.0.14-2+deb.sury.org~xenial+1
In prod environment it seems to appear when using the HttpCache with AppCache(). |
Well, I found this issue with the use of FOSHttpCacheBundle FriendsOfSymfony/FOSHttpCacheBundle#276 I use this gist https://gist.github.com/pestaa/d544870c8bf7c9ecdc1cb999ac918cbb to solve the problem. |
afair this is because of a hard to reproduce bug in opcache try completely disabling it. |
@thi3rry your issue is different and should be solved by #21184 |
Closing due to no response. @RubenHarms feel free to come back with more details and we'll re-open. |
I got the same issue with Symfony\Component\Config\ConfigCacheInterface
Env: When I run cache clear the prod/classes.php generated cause this strange error.
|
@krazygit try upgrading to Symfony 3.3 (3.2 is end of maintenance (security patches only)), and remove this line https://github.com/symfony/symfony-standard/blob/3.3/web/app.php#L12 |
@sstok: if he is using PHP >= 7.0.0, as he states, line 12 should never be called |
@NicoHaase Old versions of the Symfony Standard Edition didn't have this condition. So you need to make that change manually if you bootstrapped your project before the change was done in the repository. |
I still have this issue with Symfony 3.4 LTS. |
@Bubelbub can you provide a full stack trace to show where's the error coming from? |
I would close here: this is the same as #25484, where I stated:
|
Ok. @Bubelbub please try Nicolas' suggestion and come back if it didn't make your issue go away. |
I still have this problem with sf 3.4. I try to fix it by modify my app_dev but it's not effective. (And I removed the boostrap.cache.php file) |
It gave me a similar problem and in the end I used php version 7.0.13 and symfony 3.1 |
Have you tried updating both PHP and Symfony? Using completely outdated and no longer supported versions does not sound good |
Hi all i am trying to create a new bundle in symfony 5 . so created and folder Core in src folder
Please help me why its happening. |
@kumar2112 For support, please refer to one of the support channels. |
This might help : In my case, I simply changed |
Uh oh!
There was an error while loading. Please reload this page.
I got the following error in the console, when using a translation within a twig file (not sure if it's only in twig):
Info about environment:
PHP 7.0.13-1+deb.sury.org~xenial+1 (cli) ( NTS )
Symfony 3.0.1
The text was updated successfully, but these errors were encountered: