![](/img/trans.png)
[英]PHPUnit with Symfony Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\DoctrineBundle' not found
[英]Symfony doctrine error "DoctrineMigrationsBundle requires DoctrineBundle to be enabled."
我創建了一個新的 Symfony 項目,並且不斷收到此消息“DoctrineMigrationsBundle 需要啟用 DoctrineBundle”。 錯誤,無法擺脫它。 顯然我是 pl.net 上唯一一個得到這個錯誤的人,因為谷歌不是很有幫助。
在 config/bundles.php 文件中我有以下應該“啟用”DoctrineBundle 但我遺漏了一些東西並且無法告訴它是什么。
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
];
我有同樣的錯誤,出於某種原因,應該在config/packages
中的 yaml 文件沒有提交給 git。
您可以執行以下操作:
/bin
文件夾也丟失,也復制它 !/bin/
!/config/packages/*
(將!/bin
添加到.gitignore
與此錯誤無關,但自 symfony 6 起不應再忽略它,並且是修復此其他錯誤的解決方案: Script cache:clear returned with error code 1
Could not open input file: ./bin/console).
當您從 git 安裝 symfony 項目時。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.