我突然遇到了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
最后,我确保composer路径在我的.zshrc
文件中:
export PATH="$PATH:$HOME/.composer/vendor/bin"
我尝试删除.config/valet/config.json
文件并重新创建它。
已尝试全局更新composer、运行brew doctor并重新启动valet。
尝试了brew remove composer
,然后是brew install composer
。
已尝试chmod 0777 ~/.config/valet/config.json
并获得这些权限,但仍然出现相同的错误:
Access: (0777/-rwxrwxrwx) Uid: ( 501/ Myself) Gid: ( 70/ _www)
我该怎么解决?
2条答案
按热度按时间eiee3dmh1#
这一系列命令修复了问题:
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
(在存储库目录中)kuuvgm7e2#
我在当地也遇到了同样的问题。
我用正确的
.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