The company on a new website, but after the configuration of the PHP environment but found the problem, access to HTML fast, and access to the PHP Web page will lag 1 seconds, the response is very slow appearance, excluding the bandwidth factor, in Baidu search a lap unexpectedly solved, and now will be reproduced method to everyone, In fact, the solution is very simple oh.
IIS7.5 Web site access PHP slow response reason
The reason is that PHP5.3 above support IPV6 protocol, but everyone's server does not use IPV6, we configure the database information is similar to the "$dbhost = ' localhost ', which itself is not a problem, Just when access to PHP will be connected to MySQL address localhost,php 5.3 will consider is IPV4 or IPV6, the system will first use IPV6 connection, but did not IPv6 so to wait until the IPv6 failed to go to IPv4 so around a circle, So the speed is slow, there is a lag.
IIS7.5 Web site access to PHP response slow workaround
Method 1: Use Notepad to open the Hosts file under C:\Windows\System32\drivers\etc.
Found it:
# 127.0.0.1 localhost
Modified to:
127.0.0.1 localhost
Save the Hosts file.
Method 2:hosts file does not move, directly modify the database configuration information. Change $dbhost= ' localhost ' to $dbhost= ' 127.0.0.1 '.
All right, let's try the effect.
Windows Server 2008 Web site access PHP response Slow workaround