繁体   English   中英

Symfony 4-加载Web调试工具栏时发生错误

[英]Symfony 4 - An error occurred while loading the web debug toolbar

我正在Linux Mint(基于Ubuntu 18.04),apache2和php 7.2下工作

当我生成一个Symfony 3项目时,会生成工具栏,但是使用Symfony 4.2.5时,即使安装了费什工具,调试工具栏也不会显示。

我尝试了以下解决方案:

composer require symfony/apache-pack
chmod -R 777 var/cache

[sudo] a2enmod rewrite
[sudo] service apache2 restart

并更改了我的.htaccess:

DirectoryIndex index.php

<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    RewriteRule ^(.*) - [E=BASE:%1]

    RewriteCond %{HTTP:Authorization} .
    RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ - [L]

    RewriteRule ^ %{ENV:BASE}/index.php [L]
</IfModule>

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>
        RedirectMatch 307 ^/$ /index.php/
    </IfModule>
</IfModule>

但是在页面末尾,我仍然收到与工具栏相同的消息:

加载Web调试工具栏时发生错误。

我在Windows下工作,遇到了类似的问题,在我的情况下,安装apache-pack之后或之前甚至安装了探查器后,.htaccess文件都不存在于公用文件夹中,所以我只复制/粘贴了htaccess来自其他网站的代码,例如https://ourcodeworld.com/articles/read/793/how-to-configure-a-virtualhost-in-xampp-3-3-2-for-a-symfony-4-project ..希望这对您有所帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM