Valet: Valet does not run on Mac/Sierra OSX

Created on 25 Feb 2017  Â·  24Comments  Â·  Source: laravel/valet

I install Laravel via composer and I can run my site via Mamp and other Mac's server environments. I installed Valet and its plugins correctly and I received a message when I type valet in Terminal. But it doesn't work for me and I received ERR_EMPTY_RESPONSE when I want to visit my site in browser.
At the end when I scan 80 port (default port) via netstat -an | grep "\.80" | grep LISTEN there isn't any service running on 80.

Most helpful comment

I've fixed my setup with Valet (2.0.3) and SSL/HTTPS connections. 😅

I'm not sure if all steps are required. I updated homebrew and valet. Then I installed OpenSSL with homebrew, and curl with OpenSSL. Next I removed PHP7 to reinstall it with the homebrew curl.
Then I verified that my PHP is using OpenSSL in stead of 'Secure Transport' which ships with macOS Sierra.

I used these commands:

  • brew update
  • valet stop
  • composer global require laravel/valet
  • valet install
  • brew install openssl
  • brew install --with-openssl curl
  • brew unlink php70 && brew remove php70 && brew uninstall --ignore-dependencies php70
  • brew install --with-homebrew-curl php70
  • brew services start homebrew/php/php70
  • export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"
  • php -i | grep "SSL Version" -> SSL Version => OpenSSL/1.0.2k
  • valet restart
  • valet secure website

Hope it helps someone.

All 24 comments

@fabianhenzler I downgrade to Valet 1.1.2 and problem solved. There is something wrong with 2nd version.

Ok I also tried with 1.1.22 - the difference seems to be caddy and nginx. But also 1.1.22 resolves in endless loading and no result.
Could the dnsmasq be the issue? I can I track and narrow down the problem? :)

@fabianhenzler Make sure that dnsmasq service is run. brew services list
If it is started, reinstall it may help you.

Try switching to dev-master and seeing if it helps.
On Sun, Feb 26, 2017 at 3:50 AM Ali Ajoudanian notifications@github.com
wrote:

@fabianhenzler https://github.com/fabianhenzler Make sure that dnsmasq
service is run. brew services list
If it is started, reinstall it may help you.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/laravel/valet/issues/329#issuecomment-282542032, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AEH3bORP702meCHG16t7k78SEEJIpkaDks5rgTzkgaJpZM4ML_Fi
.

Googling for ERR_EMPTY_RESPONSE brings up multiple articles which have common threads:

  1. Port 80 is in use, so nginx can't start.
    I know you said you scanned port 80, but I've seen Caddy stay running on port 80 and not show up with netstat. Weird, I know. But a reboot after installing valet 2 solved it: Caddy dropped off and nginx could then start.

  2. DNS resolution not working properly.
    I've posted lots of troubleshooting tips for dnsmasq with valet; here are some of the discussions:

  3. Misconfigured nginx, particularly for connection timeouts, and sometimes for PHP timeouts.
    As @adamwathan mentioned, switch to valet's dev-master to benefit from a dozen merged PRs that haven't been tagged in a release yet, but which address various nginx and php configuration improvements.

Another point, which I meant to mention, got posted by @one4sorrow in https://github.com/laravel/valet/issues/307#issuecomment-282708971 today:

  • nginx and ssl work best when http2 is enabled in nginx ... if that's misconfigured then it won't work. The error may be ERR_CONNECTION_REFUSED, but I saw sometimes ERR_EMPTY_RESPONSE for it too.

Running valet secure will set the stub/vhost for your domain to expect ssl/tls and http2, but if your nginx didn't have http2 enabled (ie: you installed it manually without the http2 flag before installing valet) then you will get such errors.

I get this error now ➜ Sites sudo nginx nginx: [emerg] BIO_new_file("/Users/fabianhenzler/.valet/Certificates/matrix42.dev.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/Users/fabianhenzler/.valet/Certificates/matrix42.dev.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

how can I recreate the right certificate or make sure it's created correctly in the first place?

after using valet unsecure I have the same problem :( also with dev-master

@fabianhenzler it looks like your openssl with brew is broken. Perhaps this article may help you sort it: http://stackoverflow.com/questions/34612991/openssl-key-generation-on-os-x-failing

scr_2017-02-27_09-52-43_pm
also not working :(

I think I found the issue - Certificates got generated corrupted and a million times
https://github.com/laravel/valet/issues/326#issuecomment-282964486

I've fixed my setup with Valet (2.0.3) and SSL/HTTPS connections. 😅

I'm not sure if all steps are required. I updated homebrew and valet. Then I installed OpenSSL with homebrew, and curl with OpenSSL. Next I removed PHP7 to reinstall it with the homebrew curl.
Then I verified that my PHP is using OpenSSL in stead of 'Secure Transport' which ships with macOS Sierra.

I used these commands:

  • brew update
  • valet stop
  • composer global require laravel/valet
  • valet install
  • brew install openssl
  • brew install --with-openssl curl
  • brew unlink php70 && brew remove php70 && brew uninstall --ignore-dependencies php70
  • brew install --with-homebrew-curl php70
  • brew services start homebrew/php/php70
  • export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"
  • php -i | grep "SSL Version" -> SSL Version => OpenSSL/1.0.2k
  • valet restart
  • valet secure website

Hope it helps someone.

@lekkerduidelijk this was extremely helpful! Thankyou

This doesn't seem to work anymore with PHP version 7.0.20. Can anyone else confirm?

I can confirm it is not working for me 👎

This works for me using PHP 7.1

Not working for me on PHP 7.1.13

@varadmondkar Please feel free to open up a new issue with whatever your specific issues are.

@lekkerduidelijk Have you been able to work around this issue now that homebrew merged php into core and deprecated the old packages? with [email protected] the --with-homebrew-curl option is no longer available.

@lekkerduidelijk Did not work for [email protected] formula. Any solutions?

@Einkoro @rinseringma I did manage to upgrade to php 7.2. However I wouldn’t advice to do so unless you really need to. (I had deprecation notices all over the place, needed to reconfigure all my extensions and xdebug must be installed manually)

I used brew uninstall and brew install to upgrade my PHP version.
Unfortunately I didn’t test with SSL yet, so I’m unaware which issues might pop up.
I try to not use SSL in development anymore and it’s working just fine for me.

He arreglado mi configuración con conexiones de Valet (2.0.3) y SSL / HTTPS. 😅

No estoy seguro si todos los pasos son necesarios. Actualicé homebrew y valet. Luego instalé OpenSSL con homebrew, y doblé con OpenSSL. Luego quité PHP7 para reinstalarlo con el enrollamiento homebrew.
Luego verifiqué que mi PHP está usando OpenSSL en lugar de 'Transporte seguro' que se envía con macOS Sierra.

Utilicé estos comandos:

  • brew update
  • valet stop
  • composer global require laravel/valet
  • valet install
  • brew install openssl
  • brew install --with-openssl curl
  • brew unlink php70 && brew remove php70 && brew uninstall --ignore-dependencies php70
  • brew install --with-homebrew-curl php70
  • brew services start homebrew/php/php70
  • export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"
  • php -i | grep "SSL Version" -> Versión SSL => OpenSSL / 1.0.2k
  • valet restart
  • valet secure website

Espero que ayude a alguien.

Thanks . Workss php72

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pmochine picture pmochine  Â·  5Comments

Alshie picture Alshie  Â·  4Comments

hsleewis picture hsleewis  Â·  5Comments

ellisio picture ellisio  Â·  4Comments

LucidNinja picture LucidNinja  Â·  4Comments