【发布时间】:2019-04-15 14:40:48
【问题描述】:
我在 Linux Mint(基于 Ubuntu 18.04)、apache2 和 php 7.2 下工作
当我生成 Symfony 3 项目时,会生成工具栏,但在 Symfony 4.2.5 中,即使使用 fersh 安装,调试工具栏也不会显示。
我尝试了这个解决方案:
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 调试工具栏时出错。
【问题讨论】:
-
我什么都没改,今天工具栏又回来了!
-
嗨@zied-alaya,我不得不更改 composer.json 文件中的几行代码。请参阅我的评论以获取更多信息:stackoverflow.com/questions/56432536/…