I have Valet setup and running fine on a Laravel project. I can visit mysite.test and the project loads as it should. However, when I run the command valet share I get a "Failed to connect to 127.0.0.1 port 4040: Connection refused" error.
I've tried updating composer, updating homebrew and re-installed valet but the error message still persists. If I run brew services list the following services are all showing as running;
dnsmasq started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
[email protected] started root /Library/LaunchDaemons/[email protected]
nginx started root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php started root /Library/LaunchDaemons/homebrew.mxcl.php.plist
I don't believe that Apache is running. I get the following error when I try to stop that service;
/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
The full error I receive after running valet share is below.
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
I believe that the PHP class warning is unrelated. Any help in trying to solve this would be appreciated.
Edit:
Running sudo brew services start --all to make sure all services have indeed started results in the following error;
/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.
After hours of debugging this finally solved the issue. Specifically 'symfony/polyfill-php72', 'symfony/var-dumper', 'tightenco/collect' updated during this process so the issue must have been with one of these packages. Every other package was loaded from the cache.
composer global remove laravel/valet
composer self-update
composer global require laravel/valet
valet install
valet restart
Found another solution:
brew install ngrok
cd ~/.composer/vendor/laravel/valet/bin
./ngrok authtoken [yourtoken]
cd [back to your laravel proj]
valet share
Source and props to mgilberties: https://github.com/inconshreveable/ngrok/issues/837
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With