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

an error occurred while loading the web debug toolbar. symfony 5
symfony 4 debug toolbar not showing
symfony web debug toolbar
symfony 4 web debug toolbar not showing
symfony/apache-pack
symfony 5 debug
symfony htaccess
symfony app php

I work on CentOS.

I've followed the tutorials :

As I use Apache, I've followed this page too :

I made a default controller and a default template. With this controller (/) I get the the following error (within the debug toolbar):

An error occurred while loading the web debug toolbar. Open the web profiler.

When I click on the link : "Open the web profiler", I can see the Apache response :

Not Found
The requested URL /_profiler/177403 was not found on this server.

In the chrome inspector, I can see : GET http://172.31.18.7/_wdt/177403 404 (Not Found)

Here's the interesting part of my composer.json :

    "require": {
        "php": "^7.1.3",
        "ext-iconv": "*",
        "doctrine/doctrine-fixtures-bundle": "^3.0",
        "sensio/framework-extra-bundle": "^5.1",
        "sonata-project/admin-bundle": "^3.35",
        "sonata-project/doctrine-orm-admin-bundle": "^3.6",
        "symfony/apache-pack": "^1.0",
        "symfony/console": "^4.0",
        "symfony/flex": "^1.0",
        "symfony/framework-bundle": "^4.0",
        "symfony/lts": "^4@dev",
        "symfony/maker-bundle": "^1.4",
        "symfony/orm-pack": "^1.0",
        "symfony/requirements-checker": "^1.1",
        "symfony/security-bundle": "^4.0",
        "symfony/twig-bundle": "^4.0",
        "symfony/validator": "^4.0",
        "symfony/yaml": "^4.0"
    },
    "require-dev": {
        "sensiolabs/security-checker": "^4.1",
        "symfony/dotenv": "^4.0",
        "symfony/web-profiler-bundle": "^4.0"
    },

my httpd.conf :

<VirtualHost *:80>
DocumentRoot /var/www/html/elora/public
ServerName eloradev
ServerAlias www.elora.dev
DirectoryIndex index.php

<Directory "elora/public">
    AllowOverride all
    Order Allow,Deny
    Deny from all
    Allow from 127.0.0.1
    Allow from ::1
    Allow from localhost
</Directory>

<Directory elora>
    Options FollowSymlinks
</Directory>    

ErrorLog /var/apache/logs/error.log
CustomLog /var/apache/logs/access.log combined  

</VirtualHost>

And my .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>

And, to finish, my /lucky/number (https://symfony.com/doc/current/page_creation.html) raises the apache message :

Not Found
The requested URL /lucky/number was not found on this server.

It looks like the routing component does'nt work.

The router rules (debug:router) :

-------------------------- -------- -------- ------ -------------------
Name                       Method   Scheme   Host   Path
-------------------------- -------- -------- ------ ----------------------- 
  app_homepage               ANY      ANY      ANY    /
  app_lucky                  ANY      ANY      ANY    /lucky
  app_lucky_number           ANY      ANY      ANY    /lucky/number
  _twig_error_test           ANY      ANY      ANY    /_error/{code}.{_format}
  _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_phpinfo          ANY      ANY      ANY    /_profiler/phpinfo
  _profiler_search_results   ANY      ANY      ANY    /_profiler/{token}/search/results
  _profiler_open_file        ANY      ANY      ANY    /_profiler/open
  _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
 -------------------------- -------- -------- ------ -----------------------

I've manually created the directory /_wdt, in case, but it did'nt change anything.

I've checked errors with debug:event-dispatcher, nothing special.

I've noticed that the cache for the profiler is in that directory : var/cache/dev/profiler/03/74/ and is named 177403

One more thing, I've ran composer with the 'root' user. And I've used chown to change the owner of my project.

Here's a part of my file .env :

###> symfony/framework-bundle ###
APP_ENV=dev

An error occurred while loading the web debug toolbar. · Issue , If your really prefere debbug it with a smaller version, so i could restart this by starting with symfony/skeleton wich will be a good exercice for me  I'm working under Linux Mint (based on Ubuntu 18.04), apache2 and php 7.2 When I generate a Symfony 3 project the toolbar is generated but with Symfony 4.2.5 the debugging toolbar does not show even

just add :

FallbackResource /index.php

in your directory setting

    <Directory "/Library/WebServer/Documents/Your_public_symfony_directory">
            ....
            FallbackResource /index.php
            ....
    </Directory>

Symfony 4 : An error occurred while loading the web debug toolbar , I think this is require htaccess or mod_rewrite composer require symfony/apache-​pack. Configuring a Web Server. 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

As the response is in a comment, i repeat it :

Did you try the URL http://www.elora.dev/index.php/_wdt/ ? I had a similar problem because the URL rewriting was wrong. – A.L

That's it !

  1. /index.php doesn't have any issue with the debug toolbar
  2. /index.php/lucky/number works

Thank's a lot A.L

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  Newest. node.js - Render react component on node server, with webpack; connection - How to change Instance name in SQL Server; symfony - Symfony2 route in annotations with optional parameters

composer require symfony/apache-pack

Do you want to execute this recipe?
    [y] Yes
    [n] No
    [a] Yes for all packages, only for the current installation session
    [p] Yes permanently, never ask again for this project
    (defaults to n): y

Host File:

127.0.0.1 symfony01.com
127.0.0.1 www.symfony01.com

httpd-vhosts.conf :

<VirtualHost *:80>
    ServerName symfony01.com
    ServerAlias www.symfony01.com   
    DocumentRoot "c:/wamp64/www/symfony01/public"
    <Directory  "c:/wamp64/www/symfony01/public/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

Web Debug Toolbar & the Profiler! > Stellar Development with , The profiler is like the web debug toolbar with a fusion reactor taped onto it. psr​-4. Symfony\Bundle\WebProfilerBundle\ => . exclude-from-classmap the bar have a text indicating me : An error occurred while loading the web debug toolbar​. Salut ! Le profiler est déjà installé, le souci vient plutôt de l'environnement Apache/nginx. Il faudrait utiliser un hôte virtuel ou alors la dépendance symfony/apache-pack, comme expliqué ici.

Il sounds like a cache write issue. The profiler/debug toolbar crash because debug data is written to cache folder. Your application is probably running fine in prod environment.

To see if that's your issue, try running chmod -R 777 var/cache, and try again.

The "better fix" depend on your OS. Feel free to add some more information to answer precisely, otherwise you can have a look at Symfony related documentation here (outdated link on purpose, they removed it from SF4 doc).

Profiler (Symfony Docs), When the profiler is enabled but not the web debug toolbar, inspect the page The profiler service also provides the find() method to look for tokens based on displays the information of the initial page load and doesn't refresh after each  I'm working with Symfony 5.X, it's a fresh install on docker with the image "bitnami/symfony". I use too "bitnami/nginx" and "bitnami/php-fpm". All work good except the web profiler toolbar.

[Résolu] [Symfony 4], An error occurred while loading the web debug toolbar. Je suis tout nouveau dans l'utilisation de symfony et je me suis orienté vers la version 4  By default, symfony automatically loads several web debug panels into your web debug toolbar. By using the debug.web.load_panels event, these default panels can also be easily removed. Use the same listener function declared earlier, but replace the body with the removePanel() function.

An error occurred while loading the web debug toolbar (404: Not , An error occurred while loading the web debug toolbar (404: Not Found). ez-​publish-5-platform/randomly-errors-trying-to-load-symfony-debug-toolbar/. Has anyone got any suggestions for resolving/debugging this issue? To make sure about *actual* memory_limit value you can in the web debug Symfony toolbar hover over Symfony version in the right bottom corner and click on "View phpinfo()" link near your PHP version, then search for "memory_limit".

Symfony web debug toolbar error 500 - PHP, In Symfony I have a base.html.twig file with a Bootstrap template. the error: An error occurred while loading the web debug toolbar (500:.) Here is the code for my base template and the welcome page that extends the base. Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Comments
  • Can you check if you closed he body and html tags ?
  • I see this now and again. To fix it I delete everything under var\cache and \var\session restart Apache and then warmup the cache again, or just run the site and let the cache get rebuilt. Takes a minute longer but solves the issue
  • I didn't do any change to base.html.twig, so the tags are OK. I've forgot to say that I made a default controller and a default template. That's how I got the message "An error occurred while loading the web debug toolbar"
  • I've cleared the cache so many times ... I've restarted Apache too. Nothing new.
  • Chexk your routing rules in routing-dev.yml and see if you have any rules for the debugger.
  • Thanks this solved the issue for me running the symfony app in a vagrant box for development.
  • In my case i wanted to work with or without an .htaccess file, so ended up with a different vhost configuration, for more information: ourcodeworld.com/articles/read/793/…
  • Thank you, this worked with Laragon (Apache 2.4 + PHP 7.2).
  • Thank you for the answer, but i've already done the chmod 777 on var/cache, and the setfacl didn't change anything. My application runs in dev environment.
  • As I said, I've noticed that the cache for the profiler is in that directory : var/cache/dev/profiler/03/74/ and is named 177403 So there's not any cache write issue.