dongzongpeng6474 2017-06-18 07:27
浏览 78
已采纳

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

I am using symfony 3.3. But i cannot see the debug toolbar(_profiler) even though I did which google says correctly. I went to _profiler route also.But it says 404 error. Can someone help me?

Following is my config.yml and 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
  • 写回答

1条回答 默认 最新

  • dongxiao1591 2017-06-18 08:27
    关注

    If you send response that has not correct html structure, you do not see debug toolbar. You should have the following content in response to see debug toolbar:

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

    If you see 404, that means that you has not controller for this route, you can see your routes by:

    php bin/console debug:route
    

    Or your server is closed. You can start them by command:

    php bin/console server:run
    

    Anyway you should read about error status codes. It will save you a lot of time:

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里