相关疑难解决方法(0)

Symfony 2 - 加载Web调试工具栏时出错(404:Not Found)

自从更新到symfony 2.2以来,app_dev.php中不再加载Web调试工具栏.

我收到以下错误:

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

在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 [] []
Run Code Online (Sandbox Code Playgroud)

我已多次清除缓存:)

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

包括配置文件(/ _profiler/5fdc27cb82c4e9e426b3ab27377deb0b760fdca2),当我手动修改网址,并将app_dev.php添加到网址时,探查器正确加载.

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" …
Run Code Online (Sandbox Code Playgroud)

routing toolbar http-status-code-404 symfony

13
推荐指数
3
解决办法
2万
查看次数

Web Profiler未显示在开发中

我使用Symfony2(const版本="2.5.10")并使用xampp与PHP版本5.5.19.

我遇到了一个问题,在我的开发环境中,探查器没有出现.可能是什么问题?

config.yml

imports:
    - { resource: parameters.yml }
    - { resource: security.yml }

framework:
    #esi:             ~
    #translator:      { fallback: "%locale%" }
    translator: ~
    secret:          "%secret%"
    router:
        resource: "%kernel.root_dir%/config/routing.yml"
        strict_requirements: ~
    form:            ~
    csrf_protection: ~
    validation:      { enable_annotations: true }
    templating:
        engines: ['twig']
        #assets_version: SomeVersionScheme
    default_locale:  "%locale%"
    trusted_hosts:   ~
    trusted_proxies: ~
    session:
        # handler_id set to null will use default session handler from php.ini
        handler_id:  ~
    fragments:       ~
    http_method_override: true

# Twig Configuration
twig:
    debug:            "%kernel.debug%"
    strict_variables: "%kernel.debug%"

# Assetic …
Run Code Online (Sandbox Code Playgroud)

php profiler symfony

10
推荐指数
2
解决办法
1万
查看次数

Symfony 2.4:加载Web调试工具栏时出错(404:Not Found)

我刚刚在Debian 7.3上下载了Symfony 2.4.1的新副本.

URL /Symfony/web/config.php正确打开,但是当我继续配置时,我得到:

The requested URL /Symfony/web/app_dev.php/_configurator/ was not found on this server.
Run Code Online (Sandbox Code Playgroud)

如果我绕过配置并打开页面显示/Symfony/web/app_dev.php,但会弹出一个错误说:

An error occurred while loading the web debug toolbar (404: Not Found)
Do you want to open the profiler?
Run Code Online (Sandbox Code Playgroud)

如果我接受,我得到:

The requested URL /Symfony/web/app_dev.php/_profiler/54a8bf was not found on this server.
Run Code Online (Sandbox Code Playgroud)

在其他问题中(例如,当试图打开/app_dev.php时,Symfony 2:404 Not Found Error)人们建议摆弄.htaccess文件.我甚至尝试删除它,但它没有效果.

apache日志文件显示:

File does not exist: /var/www/Symfony/web/app_dev.php/_wdt/54a8bf, referer: http://wwwtest.di.unipi.it/Symfony/web/app_dev.php
File does not exist: /var/www/Symfony/web/app_dev.php/_profiler/54a8bf
Run Code Online (Sandbox Code Playgroud)

所以看起来路由到任何内部URL失败,尽管事实上正确的路由似乎已经到位:

> app/console router:debug
[router] Current routes
 Name                      Method Scheme Host Path
 _wdt                      ANY …
Run Code Online (Sandbox Code Playgroud)

configuration routing symfony

6
推荐指数
1
解决办法
8270
查看次数