5

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?

Ramesh Pareek
  • 1,601
  • 3
  • 30
  • 55

8 Answers8

8

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

Mostafa Norzade
  • 1,578
  • 5
  • 24
  • 40
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.

Krunal
  • 77,632
  • 48
  • 245
  • 261
ojikobeshi
  • 124
  • 1
  • 3
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 
Kibo
  • 870
  • 1
  • 15
  • 30
0

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

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;
}
SherylHohman
  • 16,580
  • 17
  • 88
  • 94
0

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

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
Akashxolotl
  • 428
  • 5
  • 6
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
hsul4n
  • 491
  • 7
  • 15