if (\PHP_SESSION_ACTIVE === session_status()) { throw new \RuntimeException('Failed to start the session: already started by PHP.'); } if (filter_var(\ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOL) && headers_sent($file, $line)) { throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)); } $sessionId = $_COOKIE[session_name()] ?? null; /* * Explanation of the session ID regular expression: `/^[a-zA-Z0-9,-]{22,250}$/`. } if (!$this->started && $this->saveHandler->isActive()) { $this->loadSession(); } elseif (!$this->started) { $this->start(); } return $this->bags[$name]; } $this->storage->registerBag(new SessionBagProxy($bag, $this->data, $this->usageIndex, $this->usageReporter)); } public function getBag(string $name): SessionBagInterface { $bag = $this->storage->getBag($name); return method_exists($bag, 'getBag') ? $bag->getBag() : $bag; } /** * * Note that this method was added to help with IDE autocompletion. */ private function getAttributeBag(): AttributeBagInterface { return $this->getBag($this->attributeName); }} /** * @return void */ public function set(string $name, mixed $value) { $this->getAttributeBag()->set($name, $value); } public function all(): array { return $this->getAttributeBag()->all(); $profileType = $request->query->get('type', 'request'); if (!$request->attributes->getBoolean('_stateless') && $request->hasSession()) { $session = $request->getSession(); $session->set('_profiler_search_ip', $ip); $session->set('_profiler_search_method', $method); $session->set('_profiler_search_status_code', $statusCode); $session->set('_profiler_search_url', $url); $session->set('_profiler_search_start', $start); $session->set('_profiler_search_end', $end); $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS); $controller = $event->getController(); $arguments = $event->getArguments(); // call controller $response = $controller(...$arguments); // view if (!$response instanceof Response) { $event = new ViewEvent($this, $request, $type, $response, $event); $this->dispatcher->dispatch($event, KernelEvents::VIEW); $request->headers->set('X-Php-Ob-Level', (string) ob_get_level()); $this->requestStack->push($request); $response = null; try { return $response = $this->handleRaw($request, $type); } catch (\Throwable $e) { if ($e instanceof \Error && !$this->handleAllThrowables) { throw $e; } $this->boot(); ++$this->requestStackSize; $this->resetServices = true; try { return $this->getHttpKernel()->handle($request, $type, $catch); } finally { --$this->requestStackSize; } } ) { } public function run(): int { $response = $this->kernel->handle($this->request); if (Kernel::VERSION_ID >= 60400) { $response->send(false); if (\function_exists('fastcgi_finish_request') && !$this->debug) {$app = $app(...$args);exit( $runtime ->getRunner($app) ->run());<?phpuse App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return function (array $context) { return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};| Level | Channel | Message |
|---|---|---|
| CRITICAL 13:04:33 | request |
Uncaught PHP Exception RuntimeException: "Failed to start the session because headers have already been sent by "/var/www/bet-analyzer/vendor/symfony/error-handler/ErrorHandler.php" at line 58." at NativeSessionStorage.php line 132 {
"exception": {}
}
|
|
RuntimeException
|
|---|
RuntimeException:
Failed to start the session because headers have already been sent by "/var/www/bet-analyzer/vendor/symfony/error-handler/ErrorHandler.php" at line 58.
at vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:132
at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
(vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:311)
at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->getBag('attributes')
(vendor/symfony/http-foundation/Session/Session.php:222)
at Symfony\Component\HttpFoundation\Session\Session->getBag('attributes')
(vendor/symfony/http-foundation/Session/Session.php:242)
at Symfony\Component\HttpFoundation\Session\Session->getAttributeBag()
(vendor/symfony/http-foundation/Session/Session.php:77)
at Symfony\Component\HttpFoundation\Session\Session->set('_profiler_search_ip', null)
(vendor/symfony/web-profiler-bundle/Controller/ProfilerController.php:267)
at Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController->searchAction(object(Request))
(vendor/symfony/http-kernel/HttpKernel.php:181)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:197)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(vendor/autoload_runtime.php:29)
at require_once('/var/www/bet-analyzer/vendor/autoload_runtime.php')
(public/index.php:5)
|