Well.. I upgraded composer and runned the command "valet install", and it works!
Laravel Valet share: Failed to connect to 127.0.0.1
Hello!
I'm trying to use the command "valet share" but I'm getting this error: [Httpful\Exception\ConnectionErrorException] Unable to connect to "http://127.0.0.1:4040/api/tunnels": 7 Failed to connect to 127.0.0.1 port 4040: Connection refused
What do I need to do?
Also this: ERROR: Tunnel 'command_line' specifies invalid address 'free.dev:80': unexpected '[' in address free.dev:80
I did it (uninstall, self-update, reinstall) but I still get the same message :(
You also get this? ERROR: Tunnel 'command_line' specifies invalid address 'free.dev:80': unexpected '[' in address free.dev:80
Yes, I had this error, not solved by the update/reinstall
composer global remove laravel/valet
composer self-update
composer global require laravel/valet
valet install
solved mine
Dali's advice (uninstall, update, reinstall) did not solve this issue on my machine. I'm running Composer -v 1.2.0, Valet v. 1.1.19 and continue to get the Failed to connect to 127.0.0.1 port 4040: Connection refused error repeating every time I try to use valet fetch-share-url from my machine. Does anyone else have any idea how to tackle this issue?
@drouten Did you check if you don't have anything listening on port 4040?
lsof -itcp:4040
Nothing listening on 4040, anything else I can provide/check? I apologize, my networking skills are still pretty light!
@drouten Do you have any error when you install valet? And then you can valet share?
Nope, composer uninstall/install work perfectly as does valet install.
I have the same issue :(
valet fetch-share-url --> Failed to connect to 127.0.0.1 port 4040: Connection refused
ā matrix42 lsof -itcp:4040
just gives me 0 result
Same issue here as well
Failed to connect to 127.0.0.1 port 4040: Connection refused
@dali's answer solved my issue
All you guys need to do:
- sudo apachectl stop
- valet restart
Don't we need to run valet share first before we run valet fetch-share-url?
I've generally experiences hours of problems upgrading Composer/Valet without it necessarily solving the problem.
Valet uses: ngrok
I installed it directly, overwriting the existing (most likely Valet) version. Plus the SSL works!
Well, same problem latest version of valet and composer also tried all of the above nothing works, nothing is using port 4040 :S ideas?
Also, make sure you are not running valet share in the Hyper terminal as it does not seem to work. https://github.com/laravel/valet/issues/790
@lecoupa So glad you posted this! I was about to give up! š
@lecoupa you are my savior
My own search brought me here for the same error. I ran valet unsecure to remove my local ssl and re attempted valet share and that worked. ngrok will give you a secure and unsecure url to share.
I had this error, followed the instructions to create an account on https://dashboard.ngrok.com/get-started/setup, am able to run ngrok http 80 with no problem, but for some reason, I keep getting this error:
An account is required to use host header rewrite.
Please register for an ngrok account at: https://dashboard.ngrok.com/signup and install your authtoken.
ERR_NGROK_9018
In CurlFactory.php line 210:
cURL error 7: Failed to connect to 127.0.0.1 port 4040 after 0 ms: Connecti
on refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for htt
p://127.0.0.1:4040/api/tunnels
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
Upgrading ngrok and then doing valet share worked for me
I need to upgrade my valet version:
composer global require laravel/valet --ignore-platform-reqs
Please or to participate in this conversation.