在 ~/.composer/vendor/laravel/valet/server.php 中被拒绝



我突然遇到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)

我该如何解决这个问题?

这一系列命令修复了这个问题:

  1. brew uninstall composer
  2. rm -rf ~/.composer
  3. valet uninstall
  4. rm -rf ~/.config/valet
  5. valet unsecure --all
  6. brew update
  7. brew install composer
  8. composer global require laravel/valet
  9. valet install
  10. valet park(现场目录(
  11. 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

相关内容

  • 没有找到相关文章

最新更新