Warning: include_once(/home/apcefrs/public_html/web/../var/bootstrap.php.cache): failed to open stream: No such file or directory in /home/apcefrs/public_html/web/app.php on line 9

Warning: include_once(): Failed opening '/home/apcefrs/public_html/web/../var/bootstrap.php.cache' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/apcefrs/public_html/web/app.php on line 9
Failed to start the session because headers have already been sent by "/home/apcefrs/public_html/web/app.php" at line 9. (500 Internal Server Error)

Symfony Exception

RuntimeException

HTTP 500 Internal Server Error

Failed to start the session because headers have already been sent by "/home/apcefrs/public_html/web/app.php" at line 9.

Exception

RuntimeException

  1. }
  2. if (\PHP_SESSION_ACTIVE === session_status()) {
  3. throw new \RuntimeException('Failed to start the session: already started by PHP.');
  4. }
  5. if (ini_get('session.use_cookies') && headers_sent($file$line)) {
  6. throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.'$file$line));
  7. }
  8. if (!session_start()) {
  9. throw new \RuntimeException('Failed to start the session');
  10. }
  11. $this->loadSession();
NativeSessionStorage->start() in var/cache/prod/classes.php (line 461)
  1. $this->flashName $flashes->getName();
  2. $this->registerBag($flashes);
  3. }
  4. public function start()
  5. {
  6. return $this->storage->start();
  7. }
  8. public function has($name)
  9. {
  10. return $this->getAttributeBag()->has($name);
  11. }
  1.      * {@inheritdoc}
  2.      */
  3.     public function hasToken($tokenId)
  4.     {
  5.         if (!$this->session->isStarted()) {
  6.             $this->session->start();
  7.         }
  8.         return $this->session->has($this->namespace.'/'.$tokenId);
  9.     }
SessionTokenStorage->hasToken('juridico') in vendor/symfony/symfony/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php (line 72)
  1.      * {@inheritdoc}
  2.      */
  3.     public function getToken($tokenId)
  4.     {
  5.         $namespacedId $this->getNamespace().$tokenId;
  6.         if ($this->storage->hasToken($namespacedId)) {
  7.             $value $this->storage->getToken($namespacedId);
  8.         } else {
  9.             $value $this->generator->generateToken();
  10.             $this->storage->setToken($namespacedId$value);
  1.     public function finishView(FormView $viewFormInterface $form, array $options)
  2.     {
  3.         if ($options['csrf_protection'] && !$view->parent && $options['compound']) {
  4.             $factory $form->getConfig()->getFormFactory();
  5.             $tokenId $options['csrf_token_id'] ?: ($form->getName() ?: get_class($form->getConfig()->getType()->getInnerType()));
  6.             $data = (string) $options['csrf_token_manager']->getToken($tokenId);
  7.             $csrfForm $factory->createNamed($options['csrf_field_name'], 'Symfony\Component\Form\Extension\Core\Type\HiddenType'$data, array(
  8.                 'mapped' => false,
  9.             ));
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, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, '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.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'attr' => array(), 'data' => object(Juridico), 'data_class' => 'AppBundle\\Entity\\Juridico', 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'upload_max_size_message' => object(Closure), 'validation_groups' => null, 'constraints' => array())) in vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php (line 174)
  1.         $this->innerType->finishView($view$form$options);
  2.         foreach ($this->typeExtensions as $extension) {
  3.             /* @var FormTypeExtensionInterface $extension */
  4.             $extension->finishView($view$form$options);
  5.         }
  6.     }
  7.     /**
  8.      * Returns the configured options resolver used for this type.
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, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, '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.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'attr' => array(), 'data' => object(Juridico), 'data_class' => 'AppBundle\\Entity\\Juridico', 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'upload_max_size_message' => object(Closure), 'validation_groups' => null, 'constraints' => array())) in vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php (line 167)
  1.      * @param array         $options The options used for the configuration
  2.      */
  3.     public function finishView(FormView $viewFormInterface $form, array $options)
  4.     {
  5.         if (null !== $this->parent) {
  6.             $this->parent->finishView($view$form$options);
  7.         }
  8.         $this->innerType->finishView($view$form$options);
  9.         foreach ($this->typeExtensions as $extension) {
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, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, '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.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'attr' => array(), 'data' => object(Juridico), 'data_class' => 'AppBundle\\Entity\\Juridico', 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'upload_max_size_message' => object(Closure), 'validation_groups' => null, 'constraints' => array())) in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php (line 1023)
  1.         foreach ($this->children as $name => $child) {
  2.             $view->children[$name] = $child->createView($view);
  3.         }
  4.         $type->finishView($view$this$options);
  5.         return $view;
  6.     }
  7.     /**
Form->createView() in src/AppBundle/Controller/PagesController.php (line 112)
  1.         $jurdico $em->getRepository(Text::class)->findOneBy([
  2.             'session' => 'juridico'
  3.         ]);
  4.         return $this->render('pages/juridico.html.twig', [
  5.             'juridico' => $jurdico,
  6.             'form' => $form->createView(),
  7.             'dados' => $dados,
  8.             'message' => $mensagem
  9.         ]);
  10.     }
PagesController->seguroJuridicoAction(object(Request), object(EntityManager), object(Swift_Mailer))
call_user_func_array(array(object(PagesController), 'seguroJuridicoAction'), array(object(Request), object(EntityManager), object(Swift_Mailer))) in var/cache/prod/classes.php (line 5006)
  1. $arguments $this->argumentResolver->getArguments($request$controller);
  2. $event = new FilterControllerArgumentsEvent($this$controller$arguments$request$type);
  3. $this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS$event);
  4. $controller $event->getController();
  5. $arguments $event->getArguments();
  6. $response = \call_user_func_array($controller$arguments);
  7. if (!$response instanceof Response) {
  8. $event = new GetResponseForControllerResultEvent($this$request$type$response);
  9. $this->dispatcher->dispatch(KernelEvents::VIEW$event);
  10. if ($event->hasResponse()) {
  11. $response $event->getResponse();
HttpKernel->handleRaw(object(Request), 1) in var/cache/prod/classes.php (line 4961)
  1. }
  2. public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true)
  3. {
  4. $request->headers->set('X-Php-Ob-Level'ob_get_level());
  5. try {
  6. return $this->handleRaw($request$type);
  7. } catch (\Exception $e) {
  8. if ($e instanceof RequestExceptionInterface) {
  9. $e = new BadRequestHttpException($e->getMessage(), $e);
  10. }
  11. if (false === $catch) {
HttpKernel->handle(object(Request), 1, true) in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php (line 169)
  1.     {
  2.         if (false === $this->booted) {
  3.             $this->boot();
  4.         }
  5.         return $this->getHttpKernel()->handle($request$type$catch);
  6.     }
  7.     /**
  8.      * Gets a HTTP kernel from the container.
  9.      *
Kernel->handle(object(Request)) in web/app.php (line 21)
  1. //$kernel = new AppCache($kernel);
  2. // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
  3. //Request::enableHttpMethodParameterOverride();
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);

Logs

No log messages

Stack Trace

RuntimeException

RuntimeException:
Failed to start the session because headers have already been sent by "/home/apcefrs/public_html/web/app.php" at line 9.

  at var/cache/prod/classes.php:112
  at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
     (var/cache/prod/classes.php:461)
  at Symfony\Component\HttpFoundation\Session\Session->start()
     (vendor/symfony/symfony/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php:78)
  at Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage->hasToken('juridico')
     (vendor/symfony/symfony/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php:72)
  at Symfony\Component\Security\Csrf\CsrfTokenManager->getToken('juridico')
     (vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php:91)
  at Symfony\Component\Form\Extension\Csrf\Type\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, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, '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.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'attr' => array(), 'data' => object(Juridico), 'data_class' => 'AppBundle\\Entity\\Juridico', 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'upload_max_size_message' => object(Closure), 'validation_groups' => null, 'constraints' => array()))
     (vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php:174)
  at Symfony\Component\Form\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, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, '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.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'attr' => array(), 'data' => object(Juridico), 'data_class' => 'AppBundle\\Entity\\Juridico', 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'upload_max_size_message' => object(Closure), 'validation_groups' => null, 'constraints' => array()))
     (vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php:167)
  at Symfony\Component\Form\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, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, '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.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'attr' => array(), 'data' => object(Juridico), 'data_class' => 'AppBundle\\Entity\\Juridico', 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'upload_max_size_message' => object(Closure), 'validation_groups' => null, 'constraints' => array()))
     (vendor/symfony/symfony/src/Symfony/Component/Form/Form.php:1023)
  at Symfony\Component\Form\Form->createView()
     (src/AppBundle/Controller/PagesController.php:112)
  at AppBundle\Controller\PagesController->seguroJuridicoAction(object(Request), object(EntityManager), object(Swift_Mailer))
  at call_user_func_array(array(object(PagesController), 'seguroJuridicoAction'), array(object(Request), object(EntityManager), object(Swift_Mailer)))
     (var/cache/prod/classes.php:5006)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (var/cache/prod/classes.php:4961)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:169)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (web/app.php:21)