Laravel was displaying to me \"Access denied for user \'homestead\'@\'localhost\' (using password: YES)\". One solution for this was clearing the cache and the config cache
Just only add folder named data
in storage/framework/cache/
and try:
php artisan cache:clear
maybe you need to chmod 777 -R storage folder. and i think it can also chown www-data:www-data
If the data
directory doesn't exist under (storage/framework/cache/data
), then you will have this error.
This data
directory doesn't exist by default on a fresh/new installation.
Creating the data
directory manually at (storage/framework/cache
) should fix this issue.
Try deleting these cached files:
/bootstrap/cache/packages.php
/bootstrap/cache/services.php
/bootstrap/cache/config.php.php
Then run php artisan cache:clear
You may need to clear the autoloader with
composer dump-autoload
If that doesn't work you can manually remove the following non-tracked (usually) files to clear the autoloader and cache if they get jammed up:
/bootstrap/cache/packages.php
/bootstrap/cache/services.php
I had the same problem but noticed if you run php artisan config:clear it also by default runs cache:clear right after it so when you run it again there is not cache in it and gives that error. you only need to run php artisan config:clear. I am not sure why cache:clear fails when its ran alone but running the config:clear is a good alternative.
Here is a helpful alias i use to clear everything in the app.
laraclear='php artisan config:cache && php artisan config:clear && php artisan view:clear && php artisan route:clear && php artisan telescope:clear && php artisan debugbar:clear'
Remove any unwanted commands that you do not use in it.