在我网站的开发环境中,调试工具栏没有出现在 symfony 3.3 中

Degbug toolbar does not appear in symfony 3.3 in dev environment in my website

我正在使用 symfony 3.3。但是我看不到调试工具栏(_profiler),即使我做了 google 说的正确。 我去了 _profiler route also.But 它说 404 错误。 有人可以帮助我吗?

以下是我的config.yml和config_dev.yml

config.yml

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

parameters:
    locale: en
framework:
   profiler:
       collect: false
   secret:    "%secret%"
   router:
        resource: "%kernel.root_dir%/config/routing.yml"
        strict_requirements: ~
   form:            ~
   csrf_protection: ~
   validation:      { enable_annotations: true }
   #serializer:      { enable_annotations: true }
   templating:
        engines: ['twig','php']
   default_locale:  "%locale%"
   usted_proxies: ~
   session:
        # http://symfony.com/doc/current/reference/configuration    /framework.html#handler-id
   handler_id:  session.handler.native_file
   save_path:   "%kernel.root_dir%/../var/sessions/%kernel.environment%"
   fragments:       ~
   http_method_override: true
   assets: ~
   php_errors:
        log: true
twig:
    debug:            "%kernel.debug%"
    strict_variables: "%kernel.debug
doctrine:
    dbal:
        driver:   pdo_mysql
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
        charset:  UTF8
    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true
swiftmailer:
        transport: "%mailer_transport%"
        host:      "%mailer_host%"
        username:  "%mailer_user%"
        password:  "%mailer_password%"
        spool:     { type: memory }
kms_froala_editor:
         language: 'en_ca'

config_dev.yml

imports:
- { resource: config.yml }

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


web_profiler:
    toolbar: true
    position: bottom
    intercept_redirects: false

monolog:
    handlers:
        main:
            type: stream
            path: "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
            channels: [!event]
        console:
            type:   console
            bubble: 
            verbosity_levels:
                VERBOSITY_VERBOS : NOTICE
                VERBOSITY_DEBUG : DEBUG
                VERBOSITY_VERY_VERBOSE : NOTICE
            channels: [!event, !doctrine]
        # uncomment to get logging in your browser
        # you may have to allow bigger header sizes in your Web server 

configuration
        firephp:
            type:   firephp
            level:  info
        chromephp:
            type:   chromephp
            level:  info

如果您发送的响应 html 结构不正确,您将看不到调试工具栏。您应该具有以下内容以响应查看调试工具栏:

<html>
    <head>
    </head>
    <body>
    </body>
</html>

如果您看到 404,则表示您没有此路线的控制器,您可以通过以下方式查看您的路线:

php bin/console debug:route

或者你的服务器关闭了。您可以通过命令启动它们:

php bin/console server:run

无论如何,您应该阅读有关错误状态代码的信息。它将为您节省大量时间:

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes