Symfony 2加载Web调试工具栏404时发生错误

时间:2013-07-16 11:48:11

标签: symfony

我基本上遇到了同样的问题:

Symfony 2 - An error occurred while loading the web debug toolbar (404: Not Found)

虽然这个解决方案对我不起作用。

我的路线没有/正在工作,当我去'/'时我得到上述错误。

正在运行php app/console router:debug会显示我列出的所有路线都正常,但实际访问它们会产生404.

我的.htaccess是

   <IfModule mod_rewrite.c>
RewriteEngine On
    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app_dev.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]    ##### this is the part that you should tweak, have the .htaccess point the request to app_dev.php, since the routing.yml is empty initially
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
RewriteRule .? %{ENV:BASE}/app_dev.php [L]        ##### this is the part that you should tweak, have the .htaccess point the request to app_dev.php, since the routing.yml is empty initially
</IfModule>

<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
    # When mod_rewrite is not available, we instruct a temporary redirect of
    # the startpage to the front controller explicitly so that the website
    # and the generated links can still be used.
    RedirectMatch 302 ^/$ /app.php/
    # RedirectTemp cannot be used instead
</IfModule>
</IfModule>

1 个答案:

答案 0 :(得分:0)

这是服务器配置问题。

安装并启用了Mod重写,所以不是这样。一个新的LAMP安装解决了它。