Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valet does not run on Mac/Sierra OSX #329

Closed
aliajoudanian opened this issue Feb 25, 2017 · 24 comments
Closed

Valet does not run on Mac/Sierra OSX #329

aliajoudanian opened this issue Feb 25, 2017 · 24 comments

Comments

@aliajoudanian
Copy link

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.

@fa8ster
Copy link

fa8ster commented Feb 26, 2017

I have a similar issue :(
Also started discussing here https://laracasts.com/discuss/channels/general-discussion/valet-203-site-is-just-not-loading

@aliajoudanian
Copy link
Author

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

@fa8ster
Copy link

fa8ster commented Feb 26, 2017

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? :)

@aliajoudanian
Copy link
Author

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

@adamwathan
Copy link
Contributor

adamwathan commented Feb 26, 2017 via email

@drbyte
Copy link
Contributor

drbyte commented Feb 26, 2017

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.

@drbyte
Copy link
Contributor

drbyte commented Feb 27, 2017

Another point, which I meant to mention, got posted by @one4sorrow in #307 (comment) 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.

@fa8ster
Copy link

fa8ster commented Feb 27, 2017

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?

@fa8ster
Copy link

fa8ster commented Feb 27, 2017

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

@drbyte
Copy link
Contributor

drbyte commented Feb 27, 2017

@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

@fa8ster
Copy link

fa8ster commented Feb 27, 2017

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

@fa8ster
Copy link

fa8ster commented Feb 28, 2017

I think I found the issue - Certificates got generated corrupted and a million times
#326 (comment)

@rutger1140
Copy link

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.

@quillstuds
Copy link

@lekkerduidelijk this was extremely helpful! Thankyou

@hotmeteor
Copy link
Contributor

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

@baberuth22
Copy link

baberuth22 commented Aug 13, 2017

I can confirm it is not working for me 👎

@bebaps
Copy link

bebaps commented Sep 8, 2017

This works for me using PHP 7.1

@varadmondkar
Copy link

Not working for me on PHP 7.1.13

@mattstauffer
Copy link
Collaborator

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

@einkoro
Copy link
Contributor

einkoro commented Apr 16, 2018

@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.

@rinseringma
Copy link

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

@rutger1140
Copy link

@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.

@chiporgar7
Copy link

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

@iamhabbeboy
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests