I spent way too long this morning debugging an issue with Debugbar for Laravel.
I had recently deleted the storage/debugbar directory while troubleshooting a different issue. Even though I had recreated the directory and all of the filesystem permissions seemed to be correct, I was still getting errors like this in my logs every time I loaded a page, and the debug bar would not show up at all:
local.ERROR: Debugbar exception: File does not exist at path /srv/storage/debugbar/01JP802XSAAA12MP4PZMARSPZD.json
Solution
Eventually I was able to solve it by following these steps:
- Run
php artisan vendor:publishand chooseBarryvdh\Debugbar\ServiceProviderto publish theconfig/debugbar.phpfile (if not already published) - Modify the
storage.driversection from'file'to'redis' - Load a page and see the debugbar show up correctly
- Reset the driver to
'file' - Reload the page and see the debugbar show up correctly
- Delete the
config/debugbar.phpfile (if no other customizations are needed)