Exception detected!

Failed to start the session because headers have already been sent by "/var/www/html/src/AppBundle/Controller/SearchController.php" at line 1227.

500 Internal Server Error - RuntimeException

Stack Trace

  1. in app/cache/prod/classes.php at line 120  -
    1. throw new \RuntimeException('Failed to start the session: already started by PHP ($_SESSION is set).');
    2. }
    3. if (ini_get('session.use_cookies') && headers_sent($file$line)) {
    4. throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.'$file$line));
    5. }
    6. if (!session_start()) {
    7. throw new \RuntimeException('Failed to start the session');
  2. at NativeSessionStorage ->start ()
    in app/cache/prod/classes.php at line 498  +
  3. at Session ->start ()
    in vendor/symfony/symfony/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php at line 78  +
  4. at SessionTokenStorage ->hasToken ('form')
    in vendor/symfony/symfony/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php at line 72  +
  5. at CsrfTokenManager ->getToken ('form')
    in vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php at line 106  +
  6. at FormTypeCsrfExtension ->finishView (object(FormView), object(Form), array('block_name' => null, 'disabled' => false, 'label' => null, 'label_format' => null, 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'max_length' => null, 'pattern' => null, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'virtual' => null, 'compound' => true, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'error_mapping' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'intention' => null, 'read_only' => false, 'attr' => array(), 'data_class' => null, 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'inherit_data' => false, 'upload_max_size_message' => object(Closure), 'validation_groups' => null, 'constraints' => array(), 'cascade_validation' => false, 'csrf_provider' => object(CsrfTokenManager), 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null))
    in vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php at line 235  +
  7. at ResolvedFormType ->finishView (object(FormView), object(Form), array('block_name' => null, 'disabled' => false, 'label' => null, 'label_format' => null, 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'max_length' => null, 'pattern' => null, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'virtual' => null, 'compound' => true, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'error_mapping' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'intention' => null, 'read_only' => false, 'attr' => array(), 'data_class' => null, 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'inherit_data' => false, 'upload_max_size_message' => object(Closure), 'validation_groups' => null, 'constraints' => array(), 'cascade_validation' => false, 'csrf_provider' => object(CsrfTokenManager), 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null))
    in vendor/symfony/symfony/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php at line 119  +
  8. at ResolvedTypeDataCollectorProxy ->finishView (object(FormView), object(Form), array('block_name' => null, 'disabled' => false, 'label' => null, 'label_format' => null, 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'max_length' => null, 'pattern' => null, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'virtual' => null, 'compound' => true, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'error_mapping' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'intention' => null, 'read_only' => false, 'attr' => array(), 'data_class' => null, 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'inherit_data' => false, 'upload_max_size_message' => object(Closure), 'validation_groups' => null, 'constraints' => array(), 'cascade_validation' => false, 'csrf_provider' => object(CsrfTokenManager), 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null))
    in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php at line 1075  +
  9. at Form ->createView ()
    in src/AppBundle/Controller/SearchController.php at line 115  +
  10. at SearchController ->searchAction ('no_search', object(Request))
    in app/bootstrap.php.cache at line 3276  +
  11. at HttpKernel ->handleRaw (object(Request), '1')
    in app/bootstrap.php.cache at line 3235  +
  12. at HttpKernel ->handle (object(Request), '1', true)
    in app/bootstrap.php.cache at line 3389  +
  13. at ContainerAwareHttpKernel ->handle (object(Request), '1', true)
    in app/bootstrap.php.cache at line 2594  +
  14. at Kernel ->handle (object(Request))
    in web/app.php at line 19  +

Logs  -

1 error
  1. INFO - Matched route "app_search_search".
  2. INFO - Populated the TokenStorage with an anonymous Token.
  3. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure".
  4. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest".
  5. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ValidateRequestListener::onKernelRequest".
  6. DEBUG - Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest".
  7. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\FragmentListener::onKernelRequest".
  8. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest".
  9. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest".
  10. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\TranslatorListener::onKernelRequest".
  11. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest".
  12. DEBUG - Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController".
  13. DEBUG - Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController".
  14. DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController".
  15. DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController".
  16. DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener::onKernelController".
  17. DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener::onKernelController".
  18. DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController".
  19. INFO - The "security.context" service is deprecated since Symfony 2.6 and will be removed in 3.0.
  20. INFO - The Symfony\Component\Security\Core\SecurityContext class is deprecated since version 2.6 and will be removed in 3.0. Use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage or Symfony\Component\Security\Core\Authorization\AuthorizationChecker instead.
  21. CRITICAL - Uncaught PHP Exception RuntimeException: "Failed to start the session because headers have already been sent by "/var/www/html/src/AppBundle/Controller/SearchController.php" at line 1227." at /var/www/html/app/cache/prod/classes.php line 120
  22. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure".
  23. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest".
  24. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ValidateRequestListener::onKernelRequest".
  25. DEBUG - Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest".
  26. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\FragmentListener::onKernelRequest".
  27. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest".
  28. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest".
  29. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\TranslatorListener::onKernelRequest".
  30. DEBUG - Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest".
  31. DEBUG - Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController".
  32. DEBUG - Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController".
  33. DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController".
  34. DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController".
  35. DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener::onKernelController".
  36. DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener::onKernelController".
  37. DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController".

Stack Trace (Plain Text)  +