0

I am developing a site using symfony2 (2.6.3) on OS X (10.10.1) nginx (1.7.6) with PHP (5.5.20 or 5.6.4 - same errors). When I enter a URL that should give (and had been until some change in the last several weeks) a 404 not found error, I get these PHP errors in prod:

(!) Fatal error: Cannot redeclare class Symfony\Component\Debug\Exception\FlattenException in /srv/www-dev/sf-   turtles/vendor/symfony/symfony/src/Symfony/Component/Debug/Exception/FlattenException.php on line 25
Call Stack
#   Time    Memory  Function    Location
1   0.0002  240392  {main}( )   ../app.php:0
2   0.0030  1253672 Symfony\Component\HttpKernel\Kernel->handle( )  ../app.php:27
3   0.0166  4842112 Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle( )    ../bootstrap.php.cache:2376
4   0.0167  4843760 Symfony\Component\HttpKernel\HttpKernel->handle( )  ../bootstrap.php.cache:3131
5   0.0308  5334944 Symfony\Component\HttpKernel\HttpKernel->handleException( ) ../bootstrap.php.cache:2988
6   0.0309  5335272 Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch( )    ../bootstrap.php.cache:3052
7   0.0310  5337312 Symfony\Component\EventDispatcher\EventDispatcher->dispatch( )  ../classes.php:2287
8   0.0311  5337792 Symfony\Component\EventDispatcher\EventDispatcher->doDispatch( )    ../classes.php:2126
9   0.0311  5338144 call_user_func:{/srv/www/sf-turtles/app/cache/prod/classes.php:2193} ( )    ../classes.php:2193
10  0.0311  5338504 Symfony\Component\HttpKernel\EventListener\ExceptionListener->onKernelException( )  ../classes.php:2193
11  0.0327  5344256 Symfony\Component\HttpKernel\EventListener\ExceptionListener->duplicateRequest( )   ../ExceptionListener.php:55
12  0.0327  5344872 spl_autoload_call ( )   ../ExceptionListener.php:115
13  0.0327  5344944 Composer\Autoload\ClassLoader->loadClass( ) ../ExceptionListener.php:0
14  0.0328  5345120 Composer\Autoload\includeFile( )    ../ClassLoader.php:278
15  0.0329  5445056 include( '/srv/www-dev/sf-turtles/vendor/symfony/symfony/src/Symfony/Component/Debug/Exception/FlattenException.php' )  ../ClassLoader   .php:386

In dev I get a blank screen.

I have tried to follow what's happening using xdebug, but navigating through the 'compiled' cache code is beyond me.

I suppose I can back off my latest changes until normal 404 operation returns, but I'm not really sure when this problem started and I have put a ton of work into this project in the last several weeks.

Does anyone out there have any ideas on what is the best way to proceed? Or can someone explain this behavior to me?

3
  • You probably forgot to add some class dependencies. his topic might help you out: stackoverflow.com/questions/21364407/… Commented Jan 12, 2015 at 11:49
  • if you are using any versioning system like GIT or Mericurial maybe you could try to spot the differences between the 2 versions. This could have lots of causes, but my "blind" guess would be related to "call_user_func" callback that tries to use twice the same class within the same namespace. Commented Jan 12, 2015 at 13:11
  • Thank you 8889 and despina. I took despina's advice and git reset to the last "working" state and manually patched my way forward. Success! The only thing different was I did NOT do a "composer update" as I had on the production system. Something got messed up in the update, but for now I'm going to let sleeping dogs lie and proceed on w/o an update. Someday I'm going to have to update, but I'm fine for now. Commented Jan 14, 2015 at 11:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.