I'm getting this issue with Laravel Valet suddenly:
Warning: file_get_contents(/Users/Myself/.config/valet/config.json): failed to open stream: Permission denied in /Users/Myself/.composer/vendor/laravel/valet/server.php on line 60
Warning: Invalid argument supplied for foreach() in /Users/Myself/.composer/vendor/laravel/valet/server.php on line 86
404 - Not Found
I tried this common solution:
sudo chown -R $(whoami) ~/.composer/vendor
I also tried:
sudo chown -R $(whoami) /Users/Myself/.config/valet/config.json
Lastly I made sure the composer path is in my .zshrc
file:
export PATH="$PATH:$HOME/.composer/vendor/bin"
I tried deleting the .config/valet/config.json
file and recreating it.
Tried updating composer globally, running brew doctor, and restarting valet.
Tried brew remove composer
followed by brew install composer
.
Tried chmod 0777 ~/.config/valet/config.json
and got these permissions but still have the same error:
Access: (0777/-rwxrwxrwx) Uid: ( 501/ Myself) Gid: ( 70/ _www)
How do I fix this?