Most PHP pages are actually database-driven, to connect to the database to display, and the reason for the long response time is that PHP 5.3 connection to the database has changed the way. At present, we configure database information like this "$dbhost = ' localhost '"; This is no problem in itself, but PHP 5.3 will consider is IPv4 or IPv6, face localhost will hesitate, so the response time is too long. If you look at the time the server is working on PHP, you will find that the time to process PHP is very short and waiting for a long time before processing.
that is, the local resolution localhost for 127.0.0.1 is too long to connect to the database
The current long response time only appears after the IIS 7 and IIS 7.5 Upgrade versions of the PHP 5.3 series, and the database version has little impact. Simply popularize the knowledge that Windows 2008 is divided into 32-bit and 64-bit, with IIS 7,windows 2008 R2 with IIS 7.5,R2 version of the system with only 64 bits. If you're using an IIS 6 or Linux system or something, there's no such problem, mostly Windows 2008 systems.
Solution:
Method One: As mentioned above, this is because PHP 5.3 in the face of the database configuration information in the "localhost" will hesitate, so directly renamed this address "127.0.0.1" can, for example:
Copy Code code as follows:
<?php
Database connection Information
$cfg _dbhost = ' localhost '; The localhost here is: 127.0.0.1
?>
Method Two: IIS 7 and IIS7.5 is the default to open the IPv6 component, now many domestic large manufacturers are also in the deployment of IPV6; If your server does not use IPV6 network, then directly disable the IPV6,
Open "%systemroot%\system32\drivers\etc\hosts" This file, comment out ":: 1 localhost" can be.
Method Three: Directly to the PHP version of the downgrade can be maintained in the PHP 5.2.17 version, which is currently the most used version, almost all of the PHP Web program can run on this version. After testing, in the PHP 5.2 series version, IIS 7 and IIS 7.5 are guaranteed to run the PHP Web program efficiently.