Win2008r2 solution to slow response of newly installed PHP websites
The company purchased a new server, and the system chose Windows Server 2008 R2 Enterprise Edition. Although I rarely use 2008, I think it's all windows, which should be about the same, right? However, after configuring the PHP environment, a problem was discovered. The speed of accessing HTML was fast, but it took a few seconds to visit the PHP web page, which seemed to have a slow response. After excluding the bandwidth factor, after various verification, the solution was actually very simple.
Use software such as Notepad or Notepad++ to open the hosts file under C:WindowsSystem32driversetc.

Find: # 127.0.0.1 localhost
Modify to: 127.0.0.1 localhost
Save the hosts file and try again. How does it work?
The reason is that PHP5.3 and above support the IPv6 protocol, but everyone's servers do not use IPv6. When accessing PHP, they will connect to MySQL at localhost. The system will use IPv6 to connect first, but there is no IPv6, so we have to wait until IPv6 fails before switching to IPv4. This way, the speed will be slow.
The online saying that God Ma tried to disable IPv6 had no effect, but it still did after using Microsoft's official IPv6 disabling tool. The correct solution posted above may not apply to you, but you may as well try it.
© Website copyright and disclaimer
1.[honmau Media] independently owns the copyright of all materials on relevant pages of this website;
2. No one is allowed to copy it without the express written permission of [honmau Media];
3. The articles that do not indicate "honmau Media" on this website are all from the Internet and are only for everyone to learn and refer;
4. If there is any infringement/violation/irregularity, please contact customer service QQ or email to delete it, please understand;
5.[honmau Media] reserves the right to correct, modify and update this statement at any time.legal notice