我创建了一个新的 Symfony 项目,并且不断收到此消息“DoctrineMigrationsBundle 需要启用 DoctrineBundle”。错误并且无法摆脱它。显然我是这个星球上唯一一个收到此错误的人,因为谷歌并没有太大帮助。
在 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],
];
我有同样的错误,
由于某种原因,应该在里面的 yaml 文件config/packages
没有致力于 git。
您可以执行以下操作:
- 创建一个新的 symfony 项目
- 将 config/packages 文件夹从全新安装复制到我的项目
- 复制
/bin
文件夹,如果也丢失的话
- 将这两行添加到 .gitignore
!/bin/
!/config/packages/*
(添加!/bin
to .gitignore
与此错误无关,但从 symfony 6 开始不应再忽略它,并且是修复此其他错误的解决方案:Script cache:clear returned with error code 1
Could not open input file: ./bin/console).
当你从 git 安装 symfony 项目时。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)