title: Symfony 2: session_start causes ERR_EMPTY_RESPONSE
body: <p>We just moved our Symfony2.3 project to another server and now we encounter the following problem:</p>
  
  <p>The routes <code>/login</code> and <code>_wdt/9d5405</code> result in a ERR_EMPTY_RESPONSE error in Google Chrome (and all other browsers showing their specific error messages). The error occurs in both, prod and dev environment.</p>
  
  <p>I tracked down the issue from my loginAction</p>
  
  <pre><code>/**
       * @Route("/login", name="login")
       * @Route("/login/{redirect}", name="login_redirect")
       * @Template()
       */
      public function loginAction($redirect = '')
      {
          if ($this-&gt;getUser())
          {
              return $this-&gt;redirect($this-&gt;generateUrl('crea_frontend_index'));
          }
  
          $request = $this-&gt;getRequest();
          $session = $request-&gt;getSession();
  
          // get the login error if there is one
          if ($request-&gt;attributes-&gt;has(SecurityContext::AUTHENTICATION_ERROR))
          {
              $error = $request-&gt;attributes-&gt;get(
                 SecurityContext::AUTHENTICATION_ERROR
              );
          }
          else
          {
              $error = $session-&gt;get(SecurityContext::AUTHENTICATION_ERROR);
              $session-&gt;remove(SecurityContext::AUTHENTICATION_ERROR);
          }
  
          $redirect = urldecode($redirect);
  
          return array(
             'last_username' =&gt; $session-&gt;get(SecurityContext::LAST_USERNAME), // last username entered by the user
             'redirect' =&gt; $redirect,
             'error' =&gt; $error,
          );
      }
  </code></pre>
  
  <p>This line produces the error:</p>
  
  <pre><code>$error = $session-&gt;get(SecurityContext::AUTHENTICATION_ERROR);
  </code></pre>
  
  <p>And I tracked it down to</p>
  
  <pre><code>Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
  </code></pre>
  
  <p>and there in line 148 <code>if (!session_start()) {</code>.</p>
  
  <p>So it turnes out that session_start at this point produces the error but when I add a <code>session_start();</code> to app.php and comment everything else it works.</p>
  
  <p>Now I am completely puzzled on how to fix this. Any ideas on how to solve this or just how to further debug would be very appriciated.</p>
  
  <ul>
  <li>PHP 5.4.20</li>
  <li>No errors in logfiles</li>
  </ul>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The error seems to be somehow related to these bug discussions:
  <a href="https://bugs.launchpad.net/ubuntu/+source/php5/+bug/424789" rel="nofollow">https://bugs.launchpad.net/ubuntu/+source/php5/+bug/424789</a>
  <a href="https://bugs.gentoo.org/show_bug.cgi?id=276583" rel="nofollow">https://bugs.gentoo.org/show_bug.cgi?id=276583</a></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p><strong>Solved:</strong> The Problem was the PHP Version 5.4.20. We tested 5.3.17 and 5.5.9. Both function well. Except 5.4.20. But I still want to know what exaclty causes this error. This could then result in a Symfony fix to deal with this version.</p>