php - 我的 symfony 网站不工作 - 文件“config.yml”不存在
问题描述
我的网站在生产环境中。我的配置文件确实存在,它说 config_.yml 不存在。我已使用已
php bin/console cache:clear --env=prod
成功清除缓存的方式清除了缓存,但在加载我的网站时出现此错误
FileLoaderLoadException in FileLoader.php line 118:
The file "config.yml" does not exist (in:[path]/app/config) in config.yml (which is being imported from "[path]/app/config/config_prod.yml").
in FileLoader.php line 118
at FileLoader->import('config.yml', null, false, '[path]/app/config/config_prod.yml') in YamlFileLoader.php line 130
at YamlFileLoader->parseImports(array('imports' => array(array('resource' => 'config.yml')), 'monolog' => array('handlers' => array('main' => array('type' => 'fingers_crossed', 'action_level' => 'error', 'handler' => 'nested'), 'nested' => array('type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug'), 'console' => array('type' => 'console')))), '[path]/app/config/config_prod.yml') in YamlFileLoader.php line 79
at YamlFileLoader->load('[path]/app/config/config_prod.yml', null) in DelegatingLoader.php line 45
at DelegatingLoader->load('[path]/app/config/config_prod.yml') in AppKernel.php line 54
at AppKernel->registerContainerConfiguration(object(DelegatingLoader)) in Kernel.php line 570
at Kernel->buildContainer() in Kernel.php line 483
at Kernel->initializeContainer() in Kernel.php line 116
at Kernel->boot() in Kernel.php line 165
at Kernel->handle(object(Request)) in app.php line 30
然后我发现我网站的所有其他页面都可以正常工作,但是这个错误显示在主页上。而且我的主页也可以正确加载www。并且没有www。它显示了这个错误。我不知道它的行为很奇怪。你们中的任何人都可以帮助我吗?现在我正在手动删除 prod 环境的缓存var/cache/prod
解决方案
推荐阅读
- python - 无法在 ubuntu 20 中使用 pymongo
- php - 如何在UPDATE查询php中使用多个复选框
- react-native - 向 React Native 组件的子组件添加样式是否有“特殊”语法?
- python - discord.py - 无法将消息副本从一台服务器发送到另一台特定服务器
- ios - M1 Mac Xcode Build Done then Failed Flutter Project (apple Silicon)
- three.js - 为什么此代码添加虚拟 DOM 元素以沿路径为三个对象设置动画?
- floating-point - 是否存在不能用定点和/或浮点类型表示的有限十进制数?
- javascript - 为现有库添加自定义类型定义
- javascript - JavaScript 更平滑的乘法循环
- flask - 通过 apscheduler 更新值后如何重新渲染我的 html