Symfony2 - Fatal error with Bundles

前端 未结 2 2034
名媛妹妹
名媛妹妹 2021-01-18 07:37

I\'ve got the error [Solution at the end of the question]

Fatal error: Class \'symblog\\Blogger\\BlogBundle\\SymblogBundle\' not found in
/var/www/Symfony/ap         


        
2条回答
  •  醉梦人生
    2021-01-18 08:07

    There are different solution.

    Clear the app/cache/(prod|dev) folder. When you have edited the Appkernel and autoload.

    Fatal error: Class 'symblog\Blogger\BlogBundle\SymblogBundle' not found in /var/www/Symfony/app/AppKernel.php on line 20

    Here are now different Problems:

    1. Look to the SymblogBundle.php in the Bundle Folder and look which namespace they use. Perhaps its really an uppercase ("S") like @kuba said.

    2. The Class file is not in the folder or you have no rights to the folder that the interpreter can load the file.

    3. I think your autoload.php is not correct.

      'Avalanche'        => __DIR__.'/../vendor/bundles',
      

      This is the common way to register an Namespace. In your case it have to be

      'Symlog' => '/var/www/Symfony/blog',
      

    Here are the instructions from the "BloggerBundle" I hope its the correct one

    There you can see the your autoload its not correct the Namespace is "Blogger".

提交回复
热议问题