1
votes

I just ran a composer update and now when I try to access my website I get this error:

ClassNotFoundException in SecurityController.php line 28: Attempted to load class "AbstractController" from namespace "Symfony\Bundle\FrameworkBundle\Controller". Did you forget a "use" statement for another namespace?

When I go into vendor/friendsofsymfony/user-bundle/Controller/SecurityController.php even PHPStorm is now telling me "Undefined class AbstractController"...

What happened to "AbstractController" and how do I get my application to work again? I've searched online and found one person who had the same issue, but there's not fix. https://github.com/FriendsOfSymfony/FOSUserBundle/issues/2678

1
Hi, try to execute again compose update and then rm -Rf var/cache/*/Maxi Schvindt
I've done that as well as clearing the cache bin/console cache:clear, and also removing the entire vendor dir and doing a composer install... Everything I get this same error.LargeTuna
Version of symfony?Maxi Schvindt
Yep. AbstractController was introduced in 3.3. Bit of a mystery how composer managed to install a FOSUserBundle which requires 3.3 or later when you have 3.2. But maybe you are using the master branch of FOSUserBundle.Cerad
Using a dev branch is always a bit dangerous since you never know when stuff might be added that is not yet ready for release. Might be better to use a stable branch. According to github, only the master branch uses the AbstractController. The latest stable tag, 2.0.2 looks fine. github.com/FriendsOfSymfony/FOSUserBundle/issues/2683Cerad

1 Answers

0
votes

I had the same problem. I solve it setting in composer.json the following line on require: "friendsofsymfony/user-bundle": "~2.0", after that I have done a composer update and that worked.