windows 2008 r2下php连接mysql的127.0.0.1快localhost慢
全文约 138 字预计阅读 1 分钟
Windows Server 2008 R2新装php5.3+mysql5.5.46发现速度不对,排查后原因是PHP5.3以上支持IPv6协议,但是大家的服务器未使用IPv6,当访问PHP的时候会连接MySQL的地址为localhost,系统会会先用IPv6连接,但又没有IPv6所以要等到IPv6失败了再转到IPv4这样绕了一圈速度当然慢了。
- 打开C:\Windows\System32\drivers\etc下的hosts文件。
windows 2008 r2下php连接mysql的127.0.0.1快localhost慢
评论 0 条
暂无评论,来说点什么吧。