Symfony 2 - Une erreur s'est produite lors du chargement de la barre d'outils de débuggage (erreur 404: page Non Trouvée)

Depuis la mise à jour symfony 2.2, la web debug toolbar n'est plus chargé en app_dev.php.

J'obtiens l'erreur suivante:

An error occurred while loading the web debug toolbar (404: Not Found).
Do you want to open the profiler?

Dans la prod.journal que je reçois le texte suivant:

request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /_profiler/84fb75cc3ffd5435474ebe4250e01fac2cdf49c1"" at /httpdocs/project/app/cache/prod/classes.php line 3597 [] []

request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /_wdt/452d5b4aa2dd9388285fa1c286d5c54218029c71"" at /httpdocs/priject/app/cache/prod/classes.php line 3597 [] []

J'ai vidé le cache plusieurs fois 🙂

Intéressant est le fait que /app_dev.php tous les liens sur la page n'est plus des liens vers d' /app_dev.php.

y compris le profil (/_profiler/5fdc27cb82c4e9e426b3ab27377deb0b760fdca2)
quand je modifie l'url à la main, et ajouter de la app_dev.php pour l'url, le profileur charge correctement.

routing_dev.yml:

_assetic:
    resource: .
    type:     assetic

_wdt:
    resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
    prefix:   /_wdt

_profiler:
    resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
    prefix:   /_profiler

_configurator:
    resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml"
    prefix:   /_configurator

_main:
    resource: routing.yml

Je serais reconnaissant pour toute aide.

I mise à JOUR: config_dev.yml

imports:
    - { resource: config.yml }

framework:
    router:   { resource: "%kernel.root_dir%/config/routing_dev.yml" }
    profiler: { only_exceptions: false }

web_profiler:
    toolbar: true
    intercept_redirects: false

monolog:
    handlers:
        main:
            type:  stream
            path:  %kernel.logs_dir%/%kernel.environment%.log
            level: debug
        firephp:
            type:  firephp
            level: info
        chromephp:
            type:  chromephp
            level: info

assetic:
    use_controller: true

Mise à JOUR II: AppKernel.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 JMS\AopBundle\JMSAopBundle(),
            new JMS\DiExtraBundle\JMSDiExtraBundle($this),
            new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
            new myProject\MyBundle\myBundle(),
            new FOS\UserBundle\FOSUserBundle(),
            new myProject\MyBackendBundle\myBackendBundle(),
       );

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

        return $bundles;
    }

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

Mise à jour III: .htaccess

DirectoryIndex app.php

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^app\.php(/(.*)|$) %{CONTEXT_PREFIX}/$2 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule .? - [L]

    RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::$
    RewriteRule ^(.*) - [E=BASE:%1]
    RewriteRule .? %{ENV:BASE}app.php [L]
</IfModule>

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>
        RedirectMatch 302 ^/$ /app.php/
    </IfModule>
</IfModule>

Mise à JOUR: j'ai trouvé l'erreur, c'était un faux (ancien) de rendre balise dans un modèle. 🙁

Merci pour votre soutien

pouvez-vous coller le contenu de votre config_dev?
pourriez-vous aussi ajouter votre AppKernel.php fichier?
Vous pouvez poster votre .htaccess avec votre RewriteRules?

OriginalL'auteur Bol | 2013-04-26