简体   繁体   中英

Symfony 2 doctrine fixtures load

I have a problem with

C:\wamp\bin\php\php5.5.12>php c:\wamp\www\symfony\app\console doctrine:fixtures:
load

Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\DoctrineBundle' not     found in
C:\wamp\www\Symfony\app\AppKernel.php on line 17

Call Stack:
0.0000     234000   1. {main}() C:\wamp\www\Symfony\app\console:0
0.0650    3390144   2. Symfony\Component\Console\Application->run() C:\wamp\
www\Symfony\app\console:27
0.0770    3622600   3. Symfony\Bundle\FrameworkBundle\Console\Application->d
oRun() C:\wamp\www\Symfony\vendor\symfony\symfony\src\Symfony\Component\Console\
Application.php:124
0.0770    3622824   4. Symfony\Component\HttpKernel\Kernel->boot() C:\wamp\w
ww\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\App
lication.php:70
0.0770    3623104   5. Symfony\Component\HttpKernel\Kernel->initializeBundle
s() C:\wamp\www\Symfony\app\bootstrap.php.cache:2303
0.0770    3623512   6. AppKernel->registerBundles() C:\wamp\www\Symfony\app\
bootstrap.php.cache:2473

Line 17 in AppKernel is correct and the file DoctrineBundle exist where it should be.

Anyone knows what is the reason of error?

The Error is clear. You add doctrine bundle to appKernel, but you don't install it (or bad install it ).

This happens when you add to AppKernel the requested namespace bundle (Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle) before composer ends the installation command.

Try to delete line 17 in the AppKernel, then a composer update and after composer updated your vendors, replace the line 17 as it was

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM