Class Not found in AppKernel.php Class Not found in AppKernel.php symfony symfony

Class Not found in AppKernel.php


If you are getting a bundle not found error in Symfony, in composer.json, modify the psr-4 section under autoload section like this.

"autoload": {    "psr-4": {        "": "src/"    },},

By doing so, you don't have to explicitly add the new bundle namespaces when you create a new bundle.


Got the same problem. I've just deleted my vendor folder

rm -rf vendor

and relaunch a composer update.. then everything was fine

composer update


If this happened in Symfony 3 (I haven't tested this in symfony 2),

  1. Make sure your bundle is registered in AppKernal.php as:

    public function registerBundles(){    $bundles = array(        ...        new YourBundle\YourBundle(),    );    ...}
  2. Check if you've updated composer.json

    "autoload": {    "psr-4": {        "AppBundle\\": "src/AppBundle",        "YourBundle\\": "src/YourBundle"    },    "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]},
  3. Run composer update from your console