Iis+fastcgi+php5.3+mysql5.1+gzip configuration graphics and text detailed tutorial _win server

Source: Internet
Author: User
Tags mysql download vc9 win32 zip zend metabase

Description

This post is what I have done all day and night, different from the general online article, in addition to the details of the entire configuration process and test procedures are detailed screenshots, especially in the fastcgi aspects of the use of Microsoft's "Web Platform installation program" To configure, online related content is very small, the setting of Gzip is also very detailed, to ensure that according to the map exercise can be done independently. In addition, there are detailed methods and comparisons for testing the gzip compression rate.

In this paper, there is little elaboration about the theory, just to configure the process of the most detailed introduction, so that even if the novice does not understand, according to this article can be configured with the same environment, this article errors and omissions, but also please point out, we have in the configuration of what problems, we together to explore solutions.

This post is designed to help the novice quickly configure IIS + FastCGI + PHP5.3 + MySQL5.1 + gzip environment, the master can drift, this article inside the picture more, each step of the operation have detailed picture description, as long as you do, can be configured successfully.

I am very happy if you have learned something after reading this article.

Today's 0 morning World Cup, not surprisingly, Spain won

The following is the text, more pictures, so all the pictures are stored on my own website, with the link cited over, there are some watermark, easy to reprint, but also hope that everyone forgive me.

============================================

Iis+fastcgi+php5.3+mysql5.1+gzip detailed configuration graphics and text tutorial

The name and download address of the software used in this article:

Php5.3.2:php-5.3.2-nts-win32-vc9-x86.zip

Address:

Http://windows.php.net/downloads/releases/php-5.3.2-nts-Win32-VC9-x86.zip

Mysql:mysql-essential-5.1.48-win32.msi

Address:

Http://windows.php.net/downloads/releases/php-5.3.2-nts-Win32-VC9-x86.zip

FastCGI: There are two ways to configure this, which is described in detail in the body

phpMyAdmin: This article uses the 3.3.4 edition

Zend Optimizer: The current Zend Optimizer still do not support PHP5.3.2, and so after the new version of our reload.

Preface: PHP5.3 's version selection

PHP5.3 for Windows now has a total of four versions: VC9 x86 Non thread safe, VC9 x86 thread safe, VC6 x86 thread safe, Non VC6 thread safe, reference ph P official website provides downloads to the left of the English to see what the difference is in these versions.

First, how to select the PHP5.3 VC9 version and VC6 version

The VC6 version is compiled using the visual Studio 6 compiler, and if your PHP is set up with Apache, you choose the VC6 version.

The VC9 version is compiled using the visual Studio 2008 compiler, and if your PHP is set up with IIS, you will choose the VC9 version.

Ii. How to select the PHP5.3 thread safe and non thread safe version

First of all, thread safe is threaded and, when executed, thread (thread) security checks are performed to prevent new requirements from running out of system resources in the form of CGI execution that starts a new thread. Non thread safety is not thread safe and does not carry out thread security checks at execution time.

Then look at the two ways PHP executes: ISAPI and fastcgi.

ISAPI execution is in the form of DLL dynamic library, can be executed after the user request, after processing a user request will not disappear immediately, so the need for thread security checks, so as to improve the efficiency of program execution, so if you are using ISAPI to execute PHP, it is recommended to select thread Safe version;

The fastcgi execution is done with a single thread, so there is no need for thread security checks, and the removal of thread security checks can improve execution efficiency, so if you are fastcgi to execute PHP, it is recommended that you choose non thread safe version.

We use the Iis+fastcgi method to configure the server environment, so we use the non Thread safe version.

Learn how to select the PHP version, and start our iis+php5.3+mysql5.1+gzip configuration process below

First step: Manually configure PHP5.3

Download the latest edition of PHP5.3.2 so far

Because the manual configuration is more flexible and more understanding of the details, so we introduce the manual configuration of PHP, so choose to download the zip file: php-5.3.2-nts-win32-vc9-x86.zip.

1, decompression php-5.3.2-nts-win32-vc9-x86.zip to the installation directory, this is C:\

2, open php-5.3.2-nts-win32-vc9-x86, set up php.ini file

Copy a new php.ini-development file and change the file name to Phi.ini.

The following figure

3, open php.ini file, modify the value of Extension_dir

Modifying the value of Data.timezone

Select Enable module: Front of the module to be used; When Php_exif.dll is enabled, it must be placed behind mbstring, and Php_exif.dll will be cut to Php_mbstring.dll.

When configuring FastCGI mode, set the Cgi.force_redirect to 0 and set cgi.rfc2616_headers and Fastcgi.impersonate to 1.

Later we will use the Iprober probe to detect the PHP environment, so we must open Short_open_tag = ON, otherwise the "iprober.php on line 910" error will appear.

At this point, the PHP part is configured completely. Here we will add support for PHP in IIS, of course, the fastcgi approach we use.

Step Two: Configure the IIS fastcgi module

There are two ways to add fastcgi modules to IIS, one is to download the fastcgi extension file directly, and the other is to use Microsoft's "Web Platform Installer", where we introduce the latter.

The first way the fastcgi Extension file name and download address is:

File name: FastCGI Extension 1.5 for IIS 6.0 and IIS 5.1-RC (x86)

Address: http://www.iis.net/downloads/default.aspx?tabid=34&i=1877&g=6

This installer requires. NET 2.0 support, verify that. NET Framework2.0 is installed.

Let's introduce the use of Microsoft's "Web Platform Installer" to configure FastCGI.

1, fastcgi First step: Open Microsoft's "Web Platform installation program", the Web site is:

Http://www.microsoft.com/web/gallery/install.aspx?appid=fastcgiiis6

Open the URL click the button in the red box below to go to the next step.

In the pop-up dialog box, click Run.

Pop-up Security Warning dialog box, click Run again.

Next is the Download Web Installer dialog box

Loading the web platform after downloading setup

After loading, eject the FastCGI Installer dialog box and click Install to continue.

Next is the agreement clause, click I accept

Formally into the installation, because the file is small, the installation process is very rapid.

Complete the installation at a later moment!

Finally, single repel and close IE

2, the following in the IIS service configuration, in IIS right click the Web site node, and then click Properties, Pop-up Properties dialog box. As shown in figure

Click the Home Directory tab, and then click the Configure button

Click Add to add a new ISAPI entry

In the C:\window\system32\inetsrv directory, select Fcgiext.dll

Notice, don't forget to add. php extension

In the C:\windows\system32\inetsrv folder, locate the Fcgiext.ini file and open

Add the following configuration information at the bottom of the Fcgiext.ini file:

[Types]

php = PHP

[PHP]

Exepath=c:\php-5.3.2-nts-win32-vc9-x86\php-cgi.exe

Now that the fastcgi configuration is complete, let's test if the configuration is correct and copy the Iprober probe program to the web directory

In the browser input: http://127.0.0.1/i/iProber.php, output the following figure:

We see the following information

How PHP runs cgi-fcgi

PHP version 5.3.2

Description iis+php fastcgi mode configuration Success!

Note that if you receive the following error message

============================

Error Details:

Error number:14001 (0X800736B1).

Error Description: Application failed to start due to improper application configuration. Reinstalling the application may correct the problem.

HTTP Error 500-server error.

Internet Information Services (IIS)

============================

The VC9 runtime is not installed, that is, Visual C + + 2008,

Microsoft Visual C + + 2008 Redistributable Package (x86) Download address:

Http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=zh-cn

Http://download.microsoft.com/download/7/5/0/7502f4e9-1f90-4895-9259-1bde67b8b9a1/vcredist_x86.exe

Step three: Enable gzip compression on IIS

About the role of gzip, here is no longer discussed, we can look up the information

1. Enable gzip Step one: Right click Web Site, click Properties, click the Services tab, select two items in the red box, and then click OK.

2. Right-click the Web Service Extension node under IIS, and then clicking Add a new Web service extension, as shown below

Add an extension with the extension "HTTP Compression", noting that the directory where Gzip.dll resides is: C:\windows\system32\inetsrv\gzip.dll

In the Web service extension for IIS, select HTTP Compression, and then click Allow on the left.

3. Set gzip parameters

Setting up gzip requires manual modification of the C:\windows\system32\inetsrv eye Recorded in the MetaBase.xml file, MetaBase.xml for the operation of IIS is very important, if the light is destroyed IIS can not be normal operation, heavy can cause the reload system, so modify this file must do a backup, the following figure named MetaBase_ The Backup.xml file is a backup.

The following sets the specific parameters for deflate and gzip:

Set deflate compression parameters, including file extension, script file extension, compression ratio, need to note that the compression ratio recommended here is 1, we will discuss which compression ratio is the most appropriate.

Set gzip compression parameters, including the file name extension, script file extension, compression ratio, you need to note that the compression ratio is still recommended set to 1.

When the configuration is complete, start IIS and make the settings take effect

4, if you do not want to stop IIS and directly edit the MetaBase.xml file, the following figure set:

If you do not want to stop IIS in the edit MetaBase.xml, on the IIS node, note that IIS is not a Web site, right-click on IIS, and click Properties

Check the "Allow direct editing of the metabase" entry to stop IIS from editing the MetaBase.xml file

5, detection gzip compression is enabled

If everyone's website posted on the Internet, you can use many online detection tools, many webmaster sites are available, how the site is on their own computer test, to detect gzip enabled, need some can crawl HTTP header information software, here recommend the use of Httpanalyzer V4, download the software, you can clearly see the role of gzip.

Let's turn off gzip first and see the year. Screenshot of HTTP headers when gzip compression is not enabled:

As you can see, the Compression saving shown in the figure above is 0, we enable gzip compression, and then look at the HTTP header information:

As you can see in the figure above, the content-encoding display is gzip, the right compression saving is the compression rate shown as 73.29%, indicating that compression is still very effective.

With this software you can also test the compression rate of your site.

6, about the compression rate set

According to the official test data, 200KB Web pages are based on the compression ratio of different gzip levels

Gzip Level 1 0.593

Gzip Level 6 (Preset) 0.586

Gzip Level 9 0.585

Thus, the compression benefits greater than 1 are very low, but officially, this consumes server resources, so they strongly recommend setting the 1,gzip preset to 6.

The actual test results for a forum are as follows:

Level 9:88.7% Compression ratio

Level 1:86.7% Compression ratio

Use my own website to test the data as follows

Level1 compression ratio is 62.93%, the compression ratio of LEVEL9 is 64.3%, we can see LEVEL1 and Level9 basic difference.

So I suggest to use 1 good, with 9 on the server load will be heavy, less people do not feel, a lot of people will be server load more heavy, and set to 1 and 9 compression than in fact not much.

Fourth Step: Install MySQL5.1

We are here to introduce the MySQL5.1.48 version.

The MySQL download address is given at the beginning of this article.

About MySQL installation is relatively simple, here only give screenshots, no longer detailed

Since Zendoptimizer has not been available for php5.3 versions, we cannot install it.

Official discussion area says, is because the php5.3 changes too big, causes zendgard also to have the very big change, therefore Zendoptimizer must wait gard perfect then can come out.

At this point, the Iis+fastcgi+php5.3+mysql+gzip complete configuration is complete.

This article from the beginning to write after the whole two days of time, because of the limited personal level, can only write the simplest article, the master will not have to look, I hope to just beginners to help, I will achieve the purpose. In this paper, there is little elaboration about the theory, just to configure the process of the most detailed introduction, so that even if the novice does not understand, according to this article can be configured with the same environment, this article errors and omissions, but also please point out, we have in the configuration of what problems, we together to explore solutions.

This article downloads the Word document address: http://www.jb51.net/books/55160.html

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.