-
Notifications
You must be signed in to change notification settings - Fork 24.4k
.env.example - Changed localhost to 127.0.0.1 #3641
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
Conversation
I believe the root cause of this is that windows will default to trying the IPv6 network first (if it's enabled). When it fails to connect, it then goes to the IPv4 network, which is actually in use by redis/mysql/sqlserver/etc. (Actually reading the linked SO article, they basically say that). Knowing that fact, I don't have a strong opinion on this one way or another (not that you care, this is just to say that I'm doing a little more than "+1", based on my experience with this issue on Windows). I'm thinking |
I honestly don't have a strong opinion about it either. I figured I'd just throw it out there to see if it would stick. At the very least this may one day show up in google for some other poor sap having similar issues. |
👍 too |
Been there, done that. Sensible default that will avoid some frustration. +1 |
.env.example - Changed localhost to 127.0.0.1
Please take into consideration that MySQL on Unix will use TCP/IP instead of a socket due to this change. |
That's interesting, could affect default settings on Redhat/CentOS servers On Fri, Jan 29, 2016 at 9:17 AM, Nick Howell notifications@github.com
|
I guess it's a measurement of the lesser of 2 evils. On one hand *nix has much more documentation and support than Windows when it comes to things like Redis. On the other *nix has a much larger user base. |
@nhowell @userscapechris It would be nice of you to share here if you find out any negative effect caused by this change. |
In laravel#3641 was decided to use `127.0.0.1` instead of `localhost` to avoid DNS lookups This change is to maintain consistency between `.env` and `database.php`
This reverts octobercms/october@1ec2b69 (bringing back octobercms/october@6c5a83d) as it is more important for the default configuration to be in a working state for most environments than to optimize for performance for some environments. Having the default be `localhost` has caused issues for a large number of people (see octobercms/october#3411, #157, and probably many more). Additionally, this has been the default in Laravel since 5.2 (laravel/laravel#3641) & 5.3 (laravel/laravel@fd42e10).
In laravel/laravel#3641 was decided to use `127.0.0.1` instead of `localhost` to avoid DNS lookups. This maintain consistency between Lumen and Laravel `.env` files.
This change was made for those developing on Windows and noticed ridiculous response times (1 second) even locally. Windows performs a DNS lookup for 'localhost' which always takes 1 second. I thought I would save the few Windows people (like myself) some time with troubleshooting slow installs of redis (this is where I first noticed it).
http://stackoverflow.com/questions/14076403/redis-connection-slow-from-php