Symfony 4 : An error occurred while loading the web debug toolbar

Today I installed Laragon and started a project with Symfony 4.3 to test somethings. Without doing nothing I got the message "An error occurred while loading the web debug toolbar" at my debug toolbar. I though that quite strange but with a quick look at Google I saw that it's being happening for quite some time now.

This happens because Apache do not know how to handle the requested URL so it returns a 404 to the profiler address. So either you manually create a .htaccess inside the public folder or you run the command

composer require symfony/apache-pack

In case you want to create your own file, this is what mine looks like:

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>

No Comments Yet

Add a comment