Autoloader expected class Symfony2 Autoloader expected class Symfony2 php php

Autoloader expected class Symfony2


Missing (or short) PHP opening tag can cause that error too. Yes it sounds funny, but if you just follow Symfony example and copy/paste whole class you may not notice that (as I didn't).


This is a little old now, but in case anyone else gets here by search:This is undoubtedly a cache issue. Manually delete the contents of app/cache/dev and app/cache/prod, and everything should resolve.


If anyone else has this issue and it doesn't go away by clearing the cache, then I recommend removing the entire folder with your composer dependencies and re-executing composer install.

It worked for me :) .