Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/site/wwwroot/vendor/symfony/error-handler/ErrorHandler.php on line 194
Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent (sent from /home/site/wwwroot/vendor/symfony/error-handler/ErrorHandler.php on line 194) (500 Internal Server Error)

Symfony Exception

ErrorException

HTTP 500 Internal Server Error

Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent (sent from /home/site/wwwroot/vendor/symfony/error-handler/ErrorHandler.php on line 194)

Exception

ErrorException

  1. if ($baseDir && !is_dir($baseDir) && !@mkdir($baseDir, 0777, true) && !is_dir($baseDir)) {
  2. throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s".', $baseDir));
  3. }
  4. if ($savePath !== \ini_get('session.save_path')) {
  5. ini_set('session.save_path', $savePath);
  6. }
  7. if ('files' !== \ini_get('session.save_handler')) {
  8. ini_set('session.save_handler', 'files');
  9. }
  10. }
  1. if (isset($container->privates['session.factory'])) {
  2. return $container->privates['session.factory'];
  3. }
  4. return $container->privates['session.factory'] = new \Symfony\Component\HttpFoundation\Session\SessionFactory(($container->services['request_stack'] ?? ($container->services['request_stack'] = new \Symfony\Component\HttpFoundation\RequestStack())), new \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorageFactory($container->parameters['session.storage.options'], new \Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler(new \Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler($container->getEnv('string:default:app_session_save_path:SESSION_SAVE_PATH'))), new \Symfony\Component\HttpFoundation\Session\Storage\MetadataBag('_sf2_meta', 0), false), [0 => $a, 1 => 'onSessionUsage']);
  5. }
  6. }
  1. $file .= '.php';
  2. }
  3. $service = require $this->containerDir.\DIRECTORY_SEPARATOR.$file;
  4. return class_exists($class, false) ? $class::do($this, $lazyLoad) : $service;
  5. }
  6. /**
  7. * Gets the public '.container.private.security.authorization_checker' shared service.
  8. *
  1. public static function do($container, $lazyLoad = true)
  2. {
  3. include_once \dirname(__DIR__, 4).'/vendor/symfony/http-foundation/Session/SessionInterface.php';
  4. include_once \dirname(__DIR__, 4).'/vendor/symfony/http-foundation/Session/Session.php';
  5. $a = ($container->privates['session.factory'] ?? $container->load('getSession_FactoryService'));
  6. if (isset($container->services['.container.private.session'])) {
  7. return $container->services['.container.private.session'];
  8. }
  1. $file .= '.php';
  2. }
  3. $service = require $this->containerDir.\DIRECTORY_SEPARATOR.$file;
  4. return class_exists($class, false) ? $class::do($this, $lazyLoad) : $service;
  5. }
  6. /**
  7. * Gets the public '.container.private.security.authorization_checker' shared service.
  8. *
  1. }
  2. if (null === $method) {
  3. return false !== $registry ? $this->{$registry}[$id] ?? null : null;
  4. }
  5. if (false !== $registry) {
  6. return $this->{$registry}[$id] ?? $this->{$registry}[$id] = $load ? $this->load($method) : $this->{$method}();
  7. }
  8. if (!$load) {
  9. return $this->{$method}();
  10. }
  1. *
  2. * @return mixed
  3. */
  4. public function get(string $id)
  5. {
  6. return isset($this->serviceMap[$id]) ? ($this->factory)(...$this->serviceMap[$id]) : parent::get($id);
  7. }
  8. /**
  9. * {@inheritdoc}
  10. */
  1. }
  2. protected function getSession(): ?SessionInterface
  3. {
  4. if ($this->container->has('session')) {
  5. return $this->container->get('session');
  6. }
  7. if ($this->container->has('session_factory')) {
  8. return $this->container->get('session_factory')->createSession();
  9. }
  1. if (!$request->hasSession()) {
  2. // This variable prevents calling `$this->getSession()` twice in case the Request (and the below factory) is cloned
  3. $sess = null;
  4. $request->setSessionFactory(function () use (&$sess, $request) {
  5. if (!$sess) {
  6. $sess = $this->getSession();
  7. $request->setSession($sess);
  8. /*
  9. * For supporting sessions in php runtime with runners like roadrunner or swoole, the session
  10. * cookie needs to be read from the cookie bag and set on the session storage.
in vendor/symfony/http-foundation/Request.php -> {closure:Symfony\Component\HttpKernel\EventListener\AbstractSessionListener::onKernelRequest():80} (line 754)
  1. */
  2. public function getSession()
  3. {
  4. $session = $this->session;
  5. if (!$session instanceof SessionInterface && null !== $session) {
  6. $this->setSession($session = $session());
  7. }
  8. if (null === $session) {
  9. throw new SessionNotFoundException('Session has not been set.');
  10. }
  1. * @return bool
  2. */
  3. public function hasPreviousSession()
  4. {
  5. // the check for $this->session avoids malicious users trying to fake a session cookie with proper name
  6. return $this->hasSession() && $this->cookies->has($this->getSession()->getName());
  7. }
  8. /**
  9. * Whether the request contains a Session object.
  10. *
  1. $this->dispatcher->addListener(KernelEvents::RESPONSE, [$this, 'onKernelResponse']);
  2. $this->registered = true;
  3. }
  4. $request = $event->getRequest();
  5. $session = $request->hasPreviousSession() && $request->hasSession() ? $request->getSession() : null;
  6. $request->attributes->set('_security_firewall_run', $this->sessionKey);
  7. if (null !== $session) {
  8. $usageIndexValue = $session instanceof Session ? $usageIndexReference = &$session->getUsageIndex() : 0;
  1. public function authenticate(RequestEvent $event)
  2. {
  3. $startTime = microtime(true);
  4. try {
  5. $ret = $this->listener->authenticate($event);
  6. } catch (LazyResponseException $e) {
  7. $this->response = $e->getResponse();
  8. throw $e;
  9. } finally {
  1. abstract class AbstractListener implements FirewallListenerInterface
  2. {
  3. final public function __invoke(RequestEvent $event)
  4. {
  5. if (false !== $this->supports($event->getRequest())) {
  6. $this->authenticate($event);
  7. }
  8. }
  9. public static function getPriority(): int
  10. {
  1. }, $listener, FirewallContext::class)();
  2. $listener($event);
  3. } else {
  4. $wrappedListener = $listener instanceof FirewallListenerInterface ? new WrappedLazyListener($listener) : new WrappedListener($listener);
  5. $wrappedListener($event);
  6. $wrappedListeners[] = $wrappedListener->getInfo();
  7. if (!$authenticatorManagerListener && $listener instanceof TraceableAuthenticatorManagerListener) {
  8. $authenticatorManagerListener = $listener;
  9. }
  10. }
in vendor/symfony/security-http/Firewall.php -> callListeners (line 92)
  1. if (null !== $logoutListener) {
  2. yield $logoutListener;
  3. }
  4. };
  5. $this->callListeners($event, $authenticationListeners());
  6. }
  7. public function onKernelFinishRequest(FinishRequestEvent $event)
  8. {
  9. $request = $event->getRequest();
  1. $this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
  2. $e = $this->stopwatch->start($this->name, 'event_listener');
  3. try {
  4. ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
  5. } finally {
  6. if ($e->isStarted()) {
  7. $e->stop();
  8. }
  9. }
  1. foreach ($listeners as $listener) {
  2. if ($stoppable && $event->isPropagationStopped()) {
  3. break;
  4. }
  5. $listener($event, $eventName, $this);
  6. }
  7. }
  8. /**
  9. * Sorts the internal list of listeners for the given event by priority.
  1. } else {
  2. $listeners = $this->getListeners($eventName);
  3. }
  4. if ($listeners) {
  5. $this->callListeners($listeners, $eventName, $event);
  6. }
  7. return $event;
  8. }
  1. try {
  2. $this->beforeDispatch($eventName, $event);
  3. try {
  4. $e = $this->stopwatch->start($eventName, 'section');
  5. try {
  6. $this->dispatcher->dispatch($event, $eventName);
  7. } finally {
  8. if ($e->isStarted()) {
  9. $e->stop();
  10. }
  11. }
  1. */
  2. private function handleRaw(Request $request, int $type = self::MAIN_REQUEST): Response
  3. {
  4. // request
  5. $event = new RequestEvent($this, $request, $type);
  6. $this->dispatcher->dispatch($event, KernelEvents::REQUEST);
  7. if ($event->hasResponse()) {
  8. return $this->filterResponse($event->getResponse(), $request, $type);
  9. }
  1. {
  2. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3. $this->requestStack->push($request);
  4. try {
  5. return $this->handleRaw($request, $type);
  6. } catch (\Exception $e) {
  7. if ($e instanceof RequestExceptionInterface) {
  8. $e = new BadRequestHttpException($e->getMessage(), $e);
  9. }
  10. if (false === $catch) {
  1. $this->boot();
  2. ++$this->requestStackSize;
  3. $this->resetServices = true;
  4. try {
  5. return $this->getHttpKernel()->handle($request, $type, $catch);
  6. } finally {
  7. --$this->requestStackSize;
  8. }
  9. }
  1. $this->request = $request;
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. $response->send();
  7. if ($this->kernel instanceof TerminableInterface) {
  8. $this->kernel->terminate($this->request, $response);
  9. }
in vendor/autoload_runtime.php -> run (line 35)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/home/site/wwwroot/vendor/autoload_runtime.php') in public/index.php (line 11)
  1. if ($appEnv !== 'dev' && $appEnv !== 'test') {
  2. error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED);
  3. ini_set('display_errors', '0');
  4. }
  5. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  6. return function (array $context) {
  7. return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  8. };

Logs

No log messages

Stack Trace

ErrorException
ErrorException:
Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent (sent from /home/site/wwwroot/vendor/symfony/error-handler/ErrorHandler.php on line 194)

  at vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php:53
  at Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler->__construct('/tmp')
     (var/cache/prod/ContainerNjxa6S9/getSession_FactoryService.php:36)
  at ContainerNjxa6S9\getSession_FactoryService::do(object(App_KernelProdDebugContainer), true)
     (var/cache/prod/ContainerNjxa6S9/App_KernelProdDebugContainer.php:445)
  at ContainerNjxa6S9\App_KernelProdDebugContainer->load('getSession_FactoryService.php')
     (var/cache/prod/ContainerNjxa6S9/get_Container_Private_SessionService.php:23)
  at ContainerNjxa6S9\get_Container_Private_SessionService::do(object(App_KernelProdDebugContainer), true)
     (var/cache/prod/ContainerNjxa6S9/App_KernelProdDebugContainer.php:445)
  at ContainerNjxa6S9\App_KernelProdDebugContainer->load('get_Container_Private_SessionService.php')
     (vendor/symfony/dependency-injection/Container.php:428)
  at Symfony\Component\DependencyInjection\Container->getService('services', '.container.private.session', 'get_Container_Private_SessionService', true)
     (vendor/symfony/dependency-injection/Argument/ServiceLocator.php:42)
  at Symfony\Component\DependencyInjection\Argument\ServiceLocator->get('session')
     (vendor/symfony/http-kernel/EventListener/SessionListener.php:51)
  at Symfony\Component\HttpKernel\EventListener\SessionListener->getSession()
     (vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php:82)
  at Symfony\Component\HttpKernel\EventListener\AbstractSessionListener->{closure:Symfony\Component\HttpKernel\EventListener\AbstractSessionListener::onKernelRequest():80}()
     (vendor/symfony/http-foundation/Request.php:754)
  at Symfony\Component\HttpFoundation\Request->getSession()
     (vendor/symfony/http-foundation/Request.php:773)
  at Symfony\Component\HttpFoundation\Request->hasPreviousSession()
     (vendor/symfony/security-http/Firewall/ContextListener.php:98)
  at Symfony\Component\Security\Http\Firewall\ContextListener->authenticate(object(RequestEvent))
     (vendor/symfony/security-bundle/Debug/WrappedLazyListener.php:49)
  at Symfony\Bundle\SecurityBundle\Debug\WrappedLazyListener->authenticate(object(RequestEvent))
     (vendor/symfony/security-http/Firewall/AbstractListener.php:26)
  at Symfony\Component\Security\Http\Firewall\AbstractListener->__invoke(object(RequestEvent))
     (vendor/symfony/security-bundle/Debug/TraceableFirewallListener.php:80)
  at Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener->callListeners(object(RequestEvent), object(Generator))
     (vendor/symfony/security-http/Firewall.php:92)
  at Symfony\Component\Security\Http\Firewall->onKernelRequest(object(RequestEvent), 'kernel.request', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(RequestEvent), 'kernel.request', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.request', object(RequestEvent))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(RequestEvent), 'kernel.request')
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(RequestEvent), 'kernel.request')
     (vendor/symfony/http-kernel/HttpKernel.php:139)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:202)
  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:35)
  at require_once('/home/site/wwwroot/vendor/autoload_runtime.php')
     (public/index.php:11)