-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Symfony version(s) affected: 3.4.18 with php 5.6
Description
After clearing the cache, when trying to access any web page of the application, the following Fatal Error occurs: Fatal error: Cannot redeclare class Symfony\Component\EventDispatcher\Event in ./var/cache/prod/classes.php on line 4471
. This happens only in prod environment.
When clearing the cache, the file classes.php is created and contains the class Symfony\Component\EventDispatcher\Event
, which seems to be unwanted, because it's already been loaded from vendor.
When deleting the file classes.php
from var/cache/prod/ and making the cache writable for apache, the automatically generated file does NOT contain the Event class and everything works.
How to reproduce
I'm not sure what changed in the last couple of weeks, when I was still on 3.4.17 it worked, but simply changing the version in composer.json back to 3.4.17 did not solve the problem.
Possible Solution
I think when creating the cache from command line, the class Event for some reason already exists and the warmer takes all the declared classes and puts them in to classes.php. I don't know why from command line and only in prod environment the class exists but otherwise not.