Win2012 R2 iis8.5+php (FastCGI) +mysql Run Environment Construction tutorial

Source: Internet
Author: User
Tags install php time zones mysql version php source code dedicated server zend

This article mainly introduces the Win2012 R2 iis8.5+php (FastCGI) +mysql Operation Environment Building tutorial, the need for friends can refer to the following

Prepare the article

First, environmental description:

Operating system: Windows Server R2

PHP Version: PHP 5.5.8

MySQL version: MySQL5.6.15

Second, related software download:

1. PHP:

Http://windows.php.net/downloads/releases/php-5.5.8-nts-Win32-VC11-x86.zip

2. MySQL:

Http://cdn.mysql.com/Downloads/MySQLInstaller/mysql-installer-community-5.6.15.0.msi

3. Visual C + + redistributable for visual Studio Update 4 (x64) (this plugin is required to install PHP):

Http://download.microsoft.com/download/9/C/D/9CD480DC-0301-41B0-AAAB-FE9AC1F60237/VSU4/vcredist_x64.exe

4. Visual C + + redistributable for visual Studio Update 4 (x86) (this plugin is required to install PHP):

Http://download.microsoft.com/download/9/C/D/9CD480DC-0301-41B0-AAAB-FE9AC1F60237/VSU4/vcredist_x86.exe

5. Microsoft Visual C + + 2010 Redistributable Package (x86) (this plugin is required to install MySQL):

Http://download.microsoft.com/download/5/B/C/5BC5DBB3-652D-4DCE-B14A-475AB85EEF6E/vcredist_x86.exe

6. Microsoft URL Rewrite Module 2.0 (IIS8.5 pseudo static requires this plugin):

Http://download.microsoft.com/download/4/E/7/4E7ECE9A-DF55-4F90-A354-B497072BDE0A/rewrite_x64_zh-CN.msi

Installation article

First, install the IIS8.5

Server Manager-Add roles and features

Next

Select: Role-based or feature-based installation

Next

Select: Select a server from the server pool

Next

Select: Web Server (IIS)

Add Features

Next

Next

Make sure that the CGI is selected, other role services are selected as needed, and if you do not know how to select them, it is recommended to select all features.

Next

Installation

Installing in progress

Show the installation is successful, click Close.

You can see that the roles and server groups already have IIS

Click the Start button, open IE browser, input HTTP://127.0.0.1/will see the following interface

IIS8.5 has been installed to complete.

Second, install PHP

1. Install Visual C + + redistributable for visual Studio Update 4 (x86)

Double-click Vcredist_x86.exe

Installation

is installing

Installation complete, close

2. Install Visual C + + redistributable for visual Studio Update 4 (x64)

Double-click Vcredist_x64.exe

Follow the steps in the previous step to install it by default

When the installation is complete, click Close

3, Installation Php-5.5.8-nts-win32-vc11-x86.zip

Unzip the Php-5.5.8-nts-win32-vc11-x86.zip file

Rename the folder to PHP, copy the PHP folder to the C packing directory

Open C:\php

Copy Php.ini-production to PHP.ini

Open php.ini with Notepad

Make the following changes:

Extension_dir = "C:\php\ext" #设置php模块路径

Date.timezone = Asia/shanghai #设置时区为中国时区

Inadvertently found LNMP default php.ini configuration in a row Date.timezone = PRC. Prc,people ' s Republic of China, PRC, that is, dates use Chinese time zones.

Date.timezone is the newly added configuration file parameter in PHP 5.1, the default date.timezone is commented out, also is the default time zone is UTC,LNMP changed to Date.timezone = PRC, this can solve the time difference of eight hours, it seems LNMP has done a good job of localization. But it seems that this parameter is generally set to Asia/shanghai it? In the official PHP document for half a day to find the PRC this parameter, it is not in the Asia category, and in Others, the average person will be in Asia to find it.

Search for PHP source code, in ext/date/lib/timezonemap.h see the following codes

{"CST",0,28800,"Asia/chongqing"},{"CST",0,28800,"Asia/chungking"},{"CST",0,28800,"Asia/harbin"},{"CST",0,28800,"Asia/kashgar"},{"CST",0,28800,"Asia/macao"},{"CST",0,28800,"Asia/macau"},{"CST",0,28800,"Asia/shanghai"},{"CST",0,28800,"Asia/taipei"},{"CST",0, 28800, "Asia/urumqi" },{ "CST", 0, 28800, "PRC" }, { "CST", 0, 28800, "ROC" },       

The time part of the PHP source code has no research, let's say that these parameters are utc+8 of the East eight district of China's Beijing Times bar.

Of course, you can call the Date_default_timezone_set function in PHP code to set the runtime time zone, which is common sense, I will not say more.

Reference: http://demon.tw/software/php-date-timezone.html

Register_globals = off #开启GET数据调用

Detailed register_globals:http://www.cnblogs.com/wawahaha/p/4820591.html

Short_open_tag = on #php支持短标签

Cgi.force_redirect = 0 #开启以CGI方式运行php

Fastcgi.impersonate = 1;

Cgi.rfc2616_headers = 1

The following PHP extension module, select on as required, cancel the preceding semicolon to start the corresponding extension module

Extension=php_curl.dll

Extension=php_gd2.dll

Extension=php_mbstring.dll

Extension=php_exif.dll

Extension=php_mysql.dll

Extension=php_mysqli.dll

Extension=php_sockets.dll

Extension=php_xmlrpc.dll

Extension=php_pdo_mysql.dll

System operation and maintenance www.osyunwei.com warm reminder: qihang01 original Content © Copyright, reproduced please indicate the source and the original link

Finally, save the exit

4. Configure IIS to support PHP

Open: Control Panel-System and security-Administrative Tools-internet information Services (IIS) Manager

Double-click the computer name under "Start Page" on the Left

Locate the middle IIS section and open the handler mappings

Add module map to the right of the point

Request Path: *.php

Module: Fastcgimodule

Executable file (optional): C:\php\php-cgi.exe

Name: FastCGI

Finally, determine

Point "yes"

Double-click the computer name under "Start Page" on the Left

Locate the middle IIS section and open the "FastCGI settings"

Right-click to select: C:\php\php-cgi.exe and select Edit

To monitor changes made to a file: C:\php\php.ini

environment variable, "..." next to the dot

Point "Add"

Name:php_fcgi_max_requests

value:1000

Are you sure

Are you sure

Double-click the computer name under "Start Page" on the Left

Locate the middle IIS section and open the "Default document"

Point to the right of "add"

Name: index.php

Are you sure

You can see that the default document already has index.php

Select the "Move Up" option on the right and move the index.php to the top

5. Test whether the PHP program is running properly

Open it:

C:\inetpub\wwwroot

Create a new index.php file

The contents are as follows:

<?php

Phpinfo ();

?>

Finally, save the exit

Open HTTP://127.0.0.1/inside the browser

The following interface appears, saying that the PHP program can run normally.

6, open Zend Opcache, accelerate PHP execution efficiency

Open the C:\php\php.ini file with Notepad and add the following code at the bottom

[Zend Opcache]

Zend_extension = "C:\php\ext\php_opcache.dll"

opcache.memory_consumption=1024

Opcache.optimization_level=1

Opcache.interned_strings_buffer=8

opcache.max_accelerated_files=4096

Opcache.revalidate_freq=60

Opcache.fast_shutdown=1

Opcache.enable=1

Opcache.enable_cli=1

Finally, save the exit

Open http://127.0.0.1/in the browser, you can see Zend Opcache configuration options

Third, install MySQL

Double hit Open Mysql-installer-community-5.6.15.0.msi

Select the first item installed MySQL products (install MySQL)

Select "I accept the License Terms" (I agree to the license terms), click Next

Check "Skip the check for update (not recommended)" (Skip checking for updates), click Next

Check "Custom" (customized installation)

Installation path (Installation path): C:\Program files\mysql\

Data path (Database storage path): C:\ProgramData\MySQL\MySQL Server 5.6\

Next

Make sure that "MySQL Server 5.6.15" is selected, click Next (Other components can choose to install)

All selected here to install all components

Execute (EXECUTE)

Select I have read and accept the license terms

Point installation

Complete

Execute (EXECUTE)

Next

Execute (EXECUTE)

System operation and maintenance www.osyunwei.com warm reminder: qihang01 original Content © Copyright, reproduced please indicate the source and the original link

Next

Next

Config type (configuration types):

Developer Machine (Development server)

Server machine (normal server)

Dedicated machine (dedicated server)

Select the second item here:Server machine (normal server)

Tick "Enable TCP/IP Networking" (Turn on TCP network port)

Port number (ports): 3306

Tick "Open firewall port for network access" (Open firewall port for networking)

Next

MySQL Root Password: enter password

Repeat Password: Enter password repeatedly

After setting up, click Next

Windows Server name (Windows service name): MySQL56

TICK: "Start the MySQL server at system startup" (Start MySQL servers at system startup)

Next

Next

Next

Dot Finish (complete)

Close this window

Open MySQL Installation path

C:\Program Files\mysql\mysql Server 5.6

Copy My-default.ini to My.ini

Enter C:\ProgramData\Microsoft\Windows\Start menu\programs\mysql\mysql Server 5.6 Directory

Open MySQL Server 5.6 Command Line Client

Enter the MySQL root account password at the time of installation, enter, log in to the MySQL console

Exit (Exit)

MySQL Installation complete

Iv. configuration IIS8.5 support pseudo-static

Double-click Install Microsoft URL Rewrite module Rewrite_x64_zh-cn.msi

Installation

is installing

Complete

In: Control Panel \ System and security \ Administrative Tools \internet information Services (IIS) Manager you can see "url rewriting"

New file Web. config under: Web site root, add pseudo-static rule code to make website static

At this point, the Windows Server R2 iis8.5+php (FastCGI) +mysql Environment Setup Tutorial is complete.

Reprint: http://www.jb51.net/article/65118.htm

Win2012 R2 iis8.5+php (FastCGI) +mysql Run Environment Construction tutorial

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.