use 127.0.0.1 instead of localhost for db host parameter#857
use 127.0.0.1 instead of localhost for db host parameter#857Flyingmana wants to merge 1 commit intomagento:developfrom
Conversation
localhost means connect via socket, which is in some cases not available or wrong configured or differs from the place php assumes it.
|
It's a long way till then, but the advantage of using localhost is that it also maps correctly for ipv6 where ::1 is the equivalent to 127.0.0.1 |
|
which is not true for PDO. PDO maps localhost to the default socket configured in php. |
|
Thanks @Flyingmana, seems like there are different opinions. Lets see if there is more comments or opinions. Maybe voting will help. For now we keep it queue. |
|
IPv6 which was already mentioned, so I won't go into that. I think we should provide a sensible default, which in my eyes is whatever the system/runtime/library decides it to be. If those decide that localhost means a socket instead, it probably has a good reason for that. I don't think we should design the framework around people that configure their stack incorrectly. |
|
👍 for what @danslo wrote. We should use localhost, and envirnoment can then resolve depending on how it's configured. |
|
Hi @Flyingmana, |
localhost means connect via socket, which is in some cases not available
or wrong configured or differs from the place php assumes it.
known Downsides: there may be performance impacts, but I never had something noticeable
Reason: It happens regularly that people have connection problems with localhost, which nearly always got resolved by changing to 127.0.0.1