我有一年前在Symfony 3.4中构建的应用程序,需要再次短暂使用,但是当我检出并尝试运行该应用程序时,出现了错误:
Cannot load resouce "<folder_path_here>". Make sure there is a loader supporting the "/config/config_dev.yml" type
以前没有这个问题,并且一直在寻找可能导致它的任何信息,但我仍然不明智。
我的config_dev.yml文件供参考:
imports:
- { resource: config.yml }
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: info
console:
type: console
bubble: false
还有我的AppKernel.php
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Checkout\Checkout()
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
}
return $bundles;
}
public function getRootDir()
{
return __DIR__;
}
public function getCacheDir()
{
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
}
public function getLogDir()
{
return dirname(__DIR__) . '/var/logs';
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__, '/config/config_' . $this->getEnvironment() . '.yml');
}
}
答案 0 :(得分:0)
别理我。我是个白痴。 registerContainerConfiguration中有一个错字。用“,”代替“。” ._。