Laravel-debugbar: Debugbar Not Showing

Created on 21 Sep 2018  路  22Comments  路  Source: barryvdh/laravel-debugbar

Issue Type

  • [x] Bug Report

End User Info

-- Laravel Version: 5.6.38

-- PHP Version: 7.2.10

-- Database Driver & Version: MariaDB 10.3.8

-- Web Server Driver & Version: NGINX 1.15.0

-- OS Driver and Version: Ubuntu 18.04.1

Issue:

  • Installed using composer require barryvdh/laravel-debugbar
  • Published config using php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"
  • Set .env
    APP_ENV=local
    APP_DEBUG=true
  • Set debugbar.php config enabled to true
  • Ran php artisan clear:all
    Clearing several common cache's ...
    Blade templates cached successfully!
    Route cache cleared!
    Routes cached successfully!
    Configuration cache cleared!
  • Cleared OPCache php artisan opcache:clear
    Opcode cache cleared

I don't see debug bar in bottom of browser...

Most helpful comment

Was having the same issue... Worked great after I cleared the rout cache...

php artisan route:cache

Hope it helps 馃憤

All 22 comments

Any ideas?

Run php artisan serve and visit http://127.0.0.1:8000/ to see if it is OK;

Visit http://127.0.0.1/non-exist-route to see if you get an 404 error instead of Whoops, looks like something went wrong....
Make sure your ngnix configuration file /etc/nginx/sites-enabled/your-site.conf has

location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ /index.php?$query_string;
        }

instead of

location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

I worked the whole night and found my problem, it's because urls are not rewritten to index.php.

@masterwto Im confused as to what php artisan serve would do? My application works fine locally (valet) and in production using a dedicated server. My applications functionality is not the issue here. Its that debugbar just doesn't show. Tried locally and on my production site.

Also my NGINX for the record is:

location / {
    try_files $uri $uri/ /index.php$is_args$args;
}

+1 not showing in Laravel 5.7 here. APP_DEBUG is true, enabled is true. I even checked on tinker config('debugbar') and enabled is true there. The Service Provider is loaded as I see the debugbar console command on artisan. Just don't understand what the issue is here?

Is this project dead or something? 20 days and no reply from devs and it seems many people having same issue as me...

Was having the same issue... Worked great after I cleared the rout cache...

php artisan route:cache

Hope it helps 馃憤

Tried all of the above, didn't budge, but creating the /storage/debugbar folder (and setting the owner to www-data in my case) caused the bar to show up.

Was having the same issue... Worked great after I cleared the rout cache...

php artisan route:cache

This worked for me.

I have the same issue as in not showing,
My setup is backend and frontend, might have to do with some namespacing
However when I set in my frontend/config/app.php

Manually to the top somewhere like this, then it does show up
Illuminate\Broadcasting\BroadcastServiceProvider::class, Illuminate\Auth\AuthServiceProvider::class, Barryvdh\Debugbar\ServiceProvider::class,
Anyone ideas why it is not showing up with the autoloaders?

Despite all my attempts, it's not working either on my website. It was working nicely before I changed my route to be managed a bit differently (I do have a multi-lingual site with language translated URI). Now it's not working... I doesn't appear, even trying everything you said before.

Could it be I enforce https through the .htaccess?

Its possibly a problem with Content Security Policy, check if there are errors in your web developer console (F12), you can also try to set 'custom-csp' => '', in your config/secure-headers.php

Run php artisan serve and visit http://127.0.0.1:8000/ to see if it is OK;

Visit http://127.0.0.1/non-exist-route to see if you get an 404 error instead of Whoops, looks like something went wrong....
Make sure your ngnix configuration file /etc/nginx/sites-enabled/your-site.conf has

location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ /index.php?$query_string;
        }

instead of

location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

I worked the whole night and found my problem, it's because urls are not rewritten to index.php.

Thanks , this helps me!
In my lnmp server , the older nginx rewrite rule is this :
location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php/$1 last; } }
, now :
location / { try_files $uri $uri/ /index.php?$query_string; }
everything is ok . Thanks .

In my case it has been solved by removing all closures from web and api routes. After that i cached my routes an the debugbar popped up. It worked before - but at some point (cannot remember or reconstruct) it disappeared.

I noticed that the thread starter stated

Route cache cleared!
Routes cached successfully!

but i wanted to comment anyway to help someone else, who maybe wasting his weekend too :D

affter sudo chmod -R 777 storage

If phpdebugbur classes exists in dom elements then look your css or js (something hide the debugbar)

Was having the same issue... Worked great after I cleared the rout cache...

php artisan route:cache

Hope it helps 馃憤

This totally worked for me after searching for a while. Thanks

I spent a lot of time to resolve this problem, maybe this will help somebody.
If You checked all instructions at github repo and debugbar still not working..
THE PROBLEM IS IN NGINX/APACHE CONFIGURATION!
In my case nginx conf 褋ontained section:

location ~ \.php$ { fastcgi_pass php-fpm:9000; try_files $uri $uri/ index.php /index.php?$args $fastcgi_script_name =404; fastcgi_index index.php; include /etc/nginx/fastcgi_params; include /etc/nginx/fastcgi.conf; }
You need to take out try files directive to section

location / { try_files $uri $uri/ index.php /index.php?$args $fastcgi_script_name =404; }
This works for me.

Why does debugbar needs a route:cache to work? i faced the same issue with laravel 5.8. Can anyone justify it?

I found the debugbar stopped working when I ran following.

composer install --optimize-autoloader --no-dev

In this case, the Debugbar wont show even the APP_ENV is local or anything other than production. I believe only marking APP_ENV as local is enough to activate debugbar.

What I did here, by executing following.

composer installand php artisan route:cache

Im using docker with Laravel v8.36.2 PHP v7.4.16 ( Other system infos are same with the author ). Debugbar does not show in my case. I tried:

  1. composer require barryvdh/laravel-debugbar --dev
  2. config/app.php:

    • Add Barryvdh\Debugbar\ServiceProvider::class to providers option

    • Add 'Debugbar' => Barryvdh\Debugbar\Facade::class to aliases option

  3. Check env:

    • APP_DEBUG=true

    • APP_ENV=local

    • Add: DEBUGBAR_ENABLED=true

  4. Run: php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"
  5. Run: php artisan route:cache
  6. Run: php artisan config:cache
  7. Run: php artisan debugbar:clear
  8. Check folder permission ( storage ): owned by www-data user and permission 777
  9. My Nginx config: `location / {
    try_files $uri $uri/ /index.php?$args;
    }
location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass app:9000;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    sendfile off;
}`

I also tried to change the config as @LisichkinVlad and @masterwto but nothing changed. It seems that I tried all ways I found in google. Can anyone help me?

Im using docker with Laravel v8.36.2 PHP v7.4.16 ( Other system infos are same with the author ). Debugbar does not show in my case. I tried:

  1. composer require barryvdh/laravel-debugbar --dev
  2. config/app.php:
  • Add Barryvdh\Debugbar\ServiceProvider::class to providers option
  • Add 'Debugbar' => Barryvdh\Debugbar\Facade::class to aliases option
  1. Check env:
  • APP_DEBUG=true
  • APP_ENV=local
  • Add: DEBUGBAR_ENABLED=true
  1. Run: php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"
  2. Run: php artisan route:cache
  3. Run: php artisan config:cache
  4. Run: php artisan debugbar:clear
  5. Check folder permission ( storage ): owned by www-data user and permission 777
  6. My Nginx config: location / { try_files $uri $uri/ /index.php?$args; } location ~ .php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; fastcgi_pass app:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; sendfile off; }
    I also tried to change the config as @LisichkinVlad and @masterwto but nothing changed. It seems that I tried all ways I found in google. Can anyone help me?

Have you been able to solve your problem? I am in a similar predicament. Using my laravel backend and Vuejs frontend in separate pods, the debugbar is not showing.

I have tried al of the above.

Im using docker with Laravel v8.36.2 PHP v7.4.16 ( Other system infos are same with the author ). Debugbar does not show in my case. I tried:

  1. composer require barryvdh/laravel-debugbar --dev
  2. config/app.php:
  • Add Barryvdh\Debugbar\ServiceProvider::class to providers option
  • Add 'Debugbar' => Barryvdh\Debugbar\Facade::class to aliases option
  1. Check env:
  • APP_DEBUG=true
  • APP_ENV=local
  • Add: DEBUGBAR_ENABLED=true
  1. Run: php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"
  2. Run: php artisan route:cache
  3. Run: php artisan config:cache
  4. Run: php artisan debugbar:clear
  5. Check folder permission ( storage ): owned by www-data user and permission 777
  6. My Nginx config: location / { try_files $uri $uri/ /index.php?$args; } location ~ .php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; fastcgi_pass app:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; sendfile off; }
    I also tried to change the config as @LisichkinVlad and @masterwto but nothing changed. It seems that I tried all ways I found in google. Can anyone help me?

Have you been able to solve your problem? I am in a similar predicament. Using my laravel backend and Vuejs frontend in separate pods, the debugbar is not showing.

I have tried al of the above.

Sorry I haven't fixed this issue. I think its better if you create a new ticket for this issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

farshadff picture farshadff  路  4Comments

innerdev picture innerdev  路  5Comments

thomthom picture thomthom  路  5Comments

Thijmen picture Thijmen  路  6Comments

ddmo picture ddmo  路  3Comments