【问题标题】:Why Symfony 3 can't open a _wdt/wdt url?为什么 Symfony 3 无法打开 _wdt/wdt url?
【发布时间】:2016-07-18 10:56:44
【问题描述】:

我已经安装了 Symfony 3 并根据文档 http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html 配置了一个 nginx。我打开 app_dev.php,Symfony 向 /_wdt 发送 ajax 请求,但得到 404 错误。 我检查了路线:

  Name                       Method   Scheme   Host   Path
 -------------------------- -------- -------- ------ -----------------------------------
  _wdt                       ANY      ANY      ANY    /_wdt/{token}
  _profiler_home             ANY      ANY      ANY    /_profiler/
  _profiler_search           ANY      ANY      ANY    /_profiler/search
  _profiler_search_bar       ANY      ANY      ANY    /_profiler/search_bar
  _profiler_info             ANY      ANY      ANY    /_profiler/info/{about}
  _profiler_phpinfo          ANY      ANY      ANY    /_profiler/phpinfo
  _profiler_search_results   ANY      ANY      ANY    /_profiler/{token}/search/results
  _profiler                  ANY      ANY      ANY    /_profiler/{token}
  _profiler_router           ANY      ANY      ANY    /_profiler/{token}/router
  _profiler_exception        ANY      ANY      ANY    /_profiler/{token}/exception
  _profiler_exception_css    ANY      ANY      ANY    /_profiler/{token}/exception.css
  _twig_error_test           ANY      ANY      ANY    /_error/{code}.{_format}
  homepage                   ANY      ANY      ANY    /
 -------------------------- -------- -------- ------ -----------------------------------

_wdt 路由存在。为什么它不起作用?

【问题讨论】:

    标签: symfony


    【解决方案1】:

    要验证你需要使用什么{token},首先像这样浏览到你的app_dev.php URL。在我的示例中,我的虚拟主机是“192.168.0.100”:

    http://192.168.0.100/app_dev.php/

    在 FireFox 中(其他浏览器会使用不同的命令)右键单击页面并选择“Inspect Element”,然后单击“Network”选项卡并刷新页面。

    您应该会看到如下内容: 获取 XHR http://192.168.40.200/app_dev.php/_wdt/d8013c

    那么这就是你可以在浏览器中输入的路线,比如上面的例子中输入:

    http://192.168.40.200/app_dev.php/_wdt/d8013c

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-06
      • 2010-12-14
      • 1970-01-01
      • 2021-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多