title: Failed user login on production server using Symfony framework (Authentication request could not be processed due to...)
body: <p>I'm using Symfony for a project and I have been trying to get the login to work on production server with no success for the past 2 days. I keep getting the error</p>
  <blockquote>
  <p>Authentication request could not be processed due to a system problem.</p>
  </blockquote>
  <p>I have followed the guide here (<a href="http://symfony.com/doc/current/cookbook/security/entity_provider.html" rel="nofollow noreferrer">http://symfony.com/doc/current/cookbook/security/entity_provider.html</a>) to setup loading users from database.</p>
  <p>My <strong>security.yml</strong> file:</p>
  <pre><code>security:
  encoders:
      Symfony\Component\Security\Core\User\User: plaintext
      Acceptme\UserBundle\Entity\User: plaintext
  role_hierarchy:
      ROLE_SUPER_ADMIN:   [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
  
  providers:
      in_memory:
          memory:
              users:
                  patricia:
                      password: patricia
                      roles: 'ROLE_ADMIN'
      users:
          name: user_provider
          entity: { class: AcceptmeUserBundle:User, property: username }
  
  firewalls:
      user_area:
          pattern: ^/
          anonymous: ~
          provider: user_provider
          form_login:
              login_path: login_route
              check_path: _login_check
              default_target_path: homepage
      dev:
          pattern: ^/(_(profiler|wdt|error)|css|images|js)/
          security: false
  
      default:
                  anonymous: ~
                  http_basic: ~
  
  access_control:
          - { path: ^/admin, roles: ROLE_ADMIN }
  </code></pre>
  <p>My <strong>SecurityController.php:</strong></p>
  <pre><code>namespace AppBundle\Controller;
  
  use Symfony\Component\HttpFoundation\Request;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
  use Symfony\Component\Security\Core\SecurityContext;
  
  class SecurityController extends Controller
  {
  /**
   * @Route(&quot;/login&quot;, name=&quot;login_route&quot;)
   * @Template(&quot;security/login.html.twig&quot;)
   */
  public function loginAction(Request $request)
  {
      if ($request-&gt;attributes-&gt;has(SecurityContext::AUTHENTICATION_ERROR)) {
          $error = $request-&gt;attributes-&gt;get(SecurityContext::AUTHENTICATION_ERROR);
      } else {
          $error = $request-&gt;getSession()-&gt;get(SecurityContext::AUTHENTICATION_ERROR);
      }
  
      return array(
          'last_username' =&gt; $request-&gt;getSession()-&gt;get(SecurityContext::LAST_USERNAME),
          'error'         =&gt; $error,
      );
  }
  
  /**
   * @Route(&quot;/login_check&quot;, name=&quot;_login_check&quot;)
   */
  public function securityCheckAction()
  {
      // this controller will not be executed,
      // as the route is handled by the Security system
  }
  }
  </code></pre>
  <p>I have tried uploading the project on 2 different web hosts (FatCow &amp; GoDaddy) and the problem remains. Locally i am using PHP 5.4.19 (FatCow uses 5.3.2 and GoDaddy uses 5.4.37). Keep in mind that when working on localhost with XAMPP everything works fine!</p>
  <p>I've confirmed that PDO is enabled in both cases. I've confirmed that the database username, password and host are correct in the <strong>parameters.yml</strong> file. Error logs on both local and remote servers show nothing.</p>
  <p>I have followed all directions from this previous post <a href="https://stackoverflow.com/questions/28135572/deploying-symfony2-app-getting-fosuserbundle-errors">Deploying Symfony2 app getting fosuserbundle errors</a> and still no success.</p>