barryvdh/laravel-debugbar does not appear in laravel
Asked Answered
C

8

6

Please let me assert: This question is not a duplicate of this,

In Laravel 5 I am trying to install barryvdh/laravel-debugbar. but it is not showing.

I did the following:

Installation:

composer require barryvdh/laravel-debugbar

Added the following lines to the config/app.php in the providers section

'Barryvdh\Debugbar\ServiceProvider',

And in the facades list..

'Debugbar' => 'Barryvdh\Debugbar\Facade', Further I execute:

php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"

After that I tried everything in answers to a similar SO question I mentioned at the beginning of this question.

Like enabling debug in .env, enable it in the debugbar.php, clearing config cache with php artisan config:clear

and caching again with

php artisan config:cache

also .. php artisan view:clear;

But the debug bar won't appear?

What could be the reasons?

Cratch answered 26/6, 2017 at 15:6 Comment(8)
Check your APP_ENV if it is local. Production might be causing the issue.Limestone
What did you set your environment to in the .env?Almazan
some time due to autoload files. Have you tried sudo composer dumpautoload ?Morty
app environment is local in .envCratch
@SagarGautam, though I did a sudo composer dumpautoload, and it did not work, your suggestion was not very good.. It gave a warning not to run composer with root permissions..Cratch
any other reasonsCratch
set debug = true in your .env fileCulbertson
it's already set to trueCratch
T
9

maybe you ‍‍cache all routes in laravel. please clear route cache:

PHP artisan route:clear

please see the below link:

When route caching is enabled, the debugbar fails to render

Tourmaline answered 23/10, 2020 at 10:24 Comment(0)
P
5

If the dev environment of your laravel project is using the default configuration of Apache for web root directory, make sure the AllowOverride All is set for the web root directory.

<Directory "/var/www/html">
   ...
   AllowOverride All 
   ...
</Directory>

Restart web service and try reloading the page. The debug bar should be showing up properly.

Photochemistry answered 31/8, 2017 at 14:56 Comment(1)
for my case bar appears on 404 pages only but not showing on other pages.Impeller
L
1

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 install and php artisan route:cache

Leblanc answered 10/5, 2021 at 7:56 Comment(1)
If you installed it as a dev dependency in composer, then it makes sense that --no-dev would remove the dependencyErichericha
A
1

In my situation, there was an issue with the creation permissions for the debugbar directory, which was resolved by creating and granting the appropriate permissions to this directory.

in your project directory run:

mkdir storage/debugbar
chmod -R 777 storage/debugbar 
Audriaaudrie answered 8/12, 2022 at 8:12 Comment(0)
F
0

Set APP_DEBUG=true in .env file in the root folder of the Laravel application.

Fellah answered 22/1, 2021 at 23:27 Comment(0)
A
0

If you checked all instructions in the github repo and the debugbar is still not working, the problem may be in your NGINX/APACHE configuration.

In my case, nginx conf сontained the 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 the try files directive to section:

location / {
    try_files $uri 
    $uri/ index.php /index.php?$args 
    $fastcgi_script_name = 404;
}
Arapaima answered 4/2, 2021 at 23:15 Comment(0)
C
0

Try these steps

composer require barryvdh/laravel-debugbar --dev
php artisan config:cache
php artisan cache:clear
php artisan route:clear
php artisan debugbar:clear
php artisan vendor:publish
composer update
Clydeclydebank answered 25/10, 2021 at 18:10 Comment(0)
P
0
  1. Make sure that app environment is set to local:
APP_ENV=local
  1. Make sure that app debug is enabled:
APP_DEBUG=true
  1. Make sure that debugbar is enabled:
DEBUGBAR_ENABLED=true
  1. Make sure to run the following commands:
php artisan cache:clear
php artisan config:cache
php artisan debugbar:clear
Psychoneurotic answered 10/10, 2022 at 10:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.