1
votes

I do hope that someone could help me to solve this strange problem. I've just installed the latest version of Symfony 3.3 and when i use the create bundle generator command in terminal it return this error message and i can't access anymore to main web page of Symfony. I work with Mac OS X 10.11.6 :

Checking that the bundle is autoloaded FAILED

Enabling the bundle inside app/AppKernel.php updated /Applications/MAMP/htdocs/Symfony/app/AppKernel.php OK Importing the bundle's routes from the app/config/routing.yml file updated /Applications/MAMP/htdocs/Symfony/app/config/routing.yml OK

The command was not able to configure everything automatically.
You'll need to make the following changes manually.

  • Edit the composer.json file and register the bundle namespace in the "autoload" section:

Thank you in advance for your kindness.

Walter.

1

1 Answers

0
votes

The message clearly states what you should do. You need to manually register your new bundle namespace in autoload section in composer.json file.

By default this section should look similar to this:

"autoload": {
    "psr-4": {
        "AppBundle\\": "src/AppBundle"
    },
    "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},

Now you need to add similar line to that for AppBundle.

E.g.:

"autoload": {
    "psr-4": {
        "AppBundle\\": "src/AppBundle",
        "ExampleNewBundle\\": "src/ExampleBundle"
    },
    "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},

I assume that your new bundle is placed under src/ExampleBundle, which is default path.

Then also run composer install or just composer dump-autoload, to let Composer generate your new autoloader classes.