Symfony 2 – 加载Web调试工具栏时发生错误(404:未找到)

Symfony 2 – 加载Web调试工具栏时发生错误(404:未找到),第1张

概述自从对symfony 2.2的更新以来,web调试工具栏不再在app_dev.php中加载. 我收到以下错误: An error occurred while loading the web debug toolbar (404: Not Found).Do you want to open the profiler? 在prod.log中,我得到以下内容: request.ERROR: Unc 自从对symfony 2.2的更新以来,web调试工具栏不再在app_dev.PHP中加载.

我收到以下错误:

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

在prod.log中,我得到以下内容:

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 [] []

我已经清除了几次缓存:)

有趣的是,在/app_dev.PHP中,页面上的所有链接不再链接到/app_dev.PHP.

包括配置文件(/ _profiler / 5fdc27cb82c4e9e426b3ab27377deb0b760fdca2)
当我手动修改url,并将app_dev.PHP添加到url,分析器加载正确.

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

我会感谢任何帮助.

UPDATE I: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: falsemonolog:    handlers:        main:            type:  stream            path:  %kernel.logs_dir%/%kernel.environment%.log            level: deBUG        firePHP:            type:  firePHP            level: info        ChromePHP:            type:  ChromePHP            level: infoassetic:    use_controller: true

更新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');    }}

更新III:.htaccess

DirectoryIndex app.PHP<IfModule mod_rewrite.c>    RewriteEngine On    RewriteCond %{ENV:REDIRECT_STATUS} ^$    RewriteRule ^app\.PHP(/(.*)|$) %{CONTEXT_PREFIX}/ [R=301,L]    RewriteCond %{REQUEST_filename} -f    RewriteRule .? - [L]    RewriteCond %{REQUEST_URI}:: ^(/.+)(.+)::$    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>

更新:我发现错误,这是模板中的一个错误(旧)渲染标记. 总结

以上是内存溢出为你收集整理的Symfony 2 – 加载Web调试工具栏时发生错误(404:未找到)全部内容,希望文章能够帮你解决Symfony 2 – 加载Web调试工具栏时发生错误(404:未找到)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1091532.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存