Laravel Valet 共享 - 无法连接到 127.0.0.1 端口 4040:连接被拒绝

Dar*_*ren 3 laravel ngrok laravel-valet valet

我在 Laravel 项目上设置了 Valet 并运行良好。我可以访问 mysite.test 并按预期加载项目。但是,当我运行valet share命令时,出现“无法连接到 127.0.0.1 端口 4040:连接被拒绝”错误。

我已经尝试更新作曲家,更新自制软件并重新安装代客泊车服务,但错误消息仍然存在。如果我运行 brew services list 以下服务都显示为正在运行;

dnsmasq   started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
mysql@5.7 started root /Library/LaunchDaemons/homebrew.mxcl.mysql@5.7.plist
nginx     started root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php       started root /Library/LaunchDaemons/homebrew.mxcl.php.plist
Run Code Online (Sandbox Code Playgroud)

我不相信 Apache 正在运行。当我尝试停止该服务时出现以下错误;

/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
Run Code Online (Sandbox Code Playgroud)

运行代客共享后收到的完整错误如下。

ERROR:  Tunnel 'command_line' specifies invalid address 'Sites.
ERROR:  Warning: Class 'Tightenco\Collect\Support\Debug\Dumper' not found in /Users/darren/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php on line 18
ERROR:  
ERROR:  Warning: Class 'Tightenco\Collect\Support\Debug\HtmlDumper' not found in /Users/darren/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php on line 18
ERROR:  test:80': too many colons in address Sites.
ERROR:  Warning: Class 'Tightenco\Collect\Support\Debug\Dumper' not found in /Users/darren/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php on line 18
ERROR:  
ERROR:  Warning: Class 'Tightenco\Collect\Support\Debug\HtmlDumper' not found in /Users/darren/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php on line 18
ERROR:  test:80
Darrens-MacBook-Pro:Sites darren$ Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused

In Request.php line 1028:

  Unable to connect to "http://127.0.0.1:4040/api/tunnels": 7 Failed to conne  
  ct to 127.0.0.1 port 4040: Connection refused                                


fetch-share-url
Run Code Online (Sandbox Code Playgroud)

我相信 PHP 类警告是无关的。任何试图解决这个问题的帮助将不胜感激。

编辑:

运行 sudo brew services start --all 以确保所有服务确实已启动会导致以下错误;

/Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist: service already loaded
Error: Failure while executing; `/bin/launchctl bootstrap system /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist` exited with 133.
Run Code Online (Sandbox Code Playgroud)

Dar*_*ren 6

经过几个小时的调试,这终于解决了这个问题。特别是在此过程中更新了“symfony/polyfill-php72”、“symfony/var-dumper”、“tightenco/collect”,因此问题一定出在这些软件包之一上。其他每个包都是从缓存中加载的。

composer global remove laravel/valet

composer self-update

composer global require laravel/valet

valet install

valet restart