控制器必须返回响应(给定null)。 您是否忘记在控制器中的某处添加return语句?

public function loginAction(Request $request)
{
     $helper = $this->get('security.authentication_utils');

   return $this->render(
       'frontend/authenticate/login.html.twig',
       array(
           'last_username' => $helper->getLastUsername(),
           'error'         => $helper->getLastAuthenticationError(),
       )
   );
}

/**
 * @Route("/login_check", name="security_login_check")
 */
public function loginCheckAction()
{

}

You should not provide an explicit action for the check_path part of the firewall definition.

Just point the check_pathproperty of your firewall to the login action as shown in:

http://symfony.com/doc/current/security/form_login_setup.html

  1. Create the Correct Routes

    First, be sure that you've defined the /login route correctly and that it corresponds to the login_path and check_path config values. A misconfiguration here can mean that you're redirected to a 404 page instead of the login page, or that submitting the login form does nothing (you just see the login form over and over again).