Php Symfony Prod模式未找到“GET”的路由

Php Symfony Prod模式未找到“GET”的路由,php,symfony,Php,Symfony,我想为我的symfony应用程序创建一个custum error404页面。 我已在以下位置创建了该文件: app/Resources/TwigBundle/views/Exception/error404.html.twig 清除了缓存,我仍然得到404 symfony开发页面 No route found for "GET /ss" 404 Not Found - NotFoundHttpException 1 linked Exception: ResourceNotFoundExcep

我想为我的symfony应用程序创建一个custum error404页面。 我已在以下位置创建了该文件:

app/Resources/TwigBundle/views/Exception/error404.html.twig
清除了缓存,我仍然得到404 symfony开发页面

No route found for "GET /ss"
404 Not Found - NotFoundHttpException
1 linked Exception: ResourceNotFoundException »
AppKernel.php

<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
public function registerBundles()
{
    $bundles = array(
        new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
        new Symfony\Bundle\SecurityBundle\SecurityBundle(),
        new Symfony\Bundle\TwigBundle\TwigBundle(),
        new Symfony\Bundle\MonologBundle\MonologBundle(),
        new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
        new Symfony\Bundle\AsseticBundle\AsseticBundle(),
        new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
        new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
        new Garcinia\SiteBundle\GarciniaSiteBundle(),
    );

    if (in_array($this->getEnvironment(), array('dev', 'test'))) {
        $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
        $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
    }

    return $bundles;
}

public function registerContainerConfiguration(LoaderInterface $loader)
{
    $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}

你在prod mod下得到了dev页面吗?oo烹饪书包含一个关于错误页面的页面::-无论在app_dev.php中发生什么,dev页面都会显示出来。您确定正在使用prod环境吗?您是否确保执行php应用程序/控制台缓存:clear-env=prod?具体地说-env=prodI我已经运行了这个命令,请看一下我的线程,我已经添加了一些filesHi@akrramokan,你应该尝试app/console route:debug来找到正确的路由,如果你找到了,那么手动删除缓存并转储资产。
$kernel = new AppKernel('prod', true);
$kernel->loadClassCache();