barryvdh/laravel-debugbar does not appear in laravel

11.8k Views Asked by At

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?

8

There are 8 best solutions below

1
On

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.

0
On

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

0
On

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

0
On

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

0
On

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;
}
0
On

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 
0
On
  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
0
On

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