首页 > 解决方案 > 我的 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

标签: phpsymfonyyamlconfig

解决方案


推荐阅读