iis7,iis7.5 upgrade PHP5.3 After the site slows down the solution _win server

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.