我突然遇到Laravel Valet的问题:
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
我尝试了这个常见的解决方案:
sudo chown -R $(whoami) ~/.composer/vendor
我也试过:
sudo chown -R $(whoami) /Users/Myself/.config/valet/config.json
最后,我确保作曲家路径在我的.zshrc
文件中:
export PATH="$PATH:$HOME/.composer/vendor/bin"
我尝试删除.config/valet/config.json
文件并重新创建它。
尝试全局更新作曲家,运行brew doctor并重新启动代客泊车。
试了brew remove composer
,然后是brew install composer
.
已尝试chmod 0777 ~/.config/valet/config.json
并获得这些权限,但仍然出现相同的错误:
Access: (0777/-rwxrwxrwx) Uid: ( 501/ Myself) Gid: ( 70/ _www)
我该如何解决这个问题?
这一系列命令修复了这个问题:
brew uninstall composer
rm -rf ~/.composer
valet uninstall
rm -rf ~/.config/valet
valet unsecure --all
brew update
brew install composer
composer global require laravel/valet
valet install
valet park
(现场目录(valet secure
(在回购目录中(
我在当地也遇到了同样的问题。
我使用正确的.valet/config.json
路径更改了~/.composer/vendor/laravel/valet/server.php
文件VALET_HOME_PATH
变量值。然后它运行良好。
参考链接: https://laracasts.com/discuss/channels/general-discussion/getting-valet-not-found-error?page=1&replyId=166071