Win2012 R2 iis8.5+php (FastCGI) +mysql running environment set up a tutorial _win server

Source: Internet
Author: User
Tags install php mysql download mysql version php download win32 dedicated server zend

Prepare an article

First, the environment description:

Operating system: Windows Server R2

PHP Version: PHP 5.5.8

MySQL version: MySQL5.6.15

Second, related software downloads:

1, PHP download address:

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

2, MySQL download address:

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

3. Visual C + + redistributable for visual Studio Update 4 (x64) download address (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) download address (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) Download address (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 download address (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

I. Installation of IIS8.5

Server Manager-adding roles and features

Next

Selecting: role-based or feature-based installation

Next

Select: Select server from server pool

Next

Selecting: Web Server (IIS)

Add Features

Next

Next

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

Next

Installation

In the process of being installed

The display installation was successful and the point was closed.

You can see that IIS is already in the roles and server groups

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

IIS8.5 has been installed.

Second, the installation of PHP

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

Double-click Vcredist_x86.exe

Installation

Being installed

Installation Complete, closing

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

After installation completes, point closes

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

Extract php-5.5.8-nts-win32-vc11-x86.zip Files

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

Open C:\php

Copy Php.ini-production to PHP.ini

Open php.ini with Notepad

Make the following modifications:

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

Date.timezone = PRC #设置时区为中国时区

Register_globals = on #开启GET数据调用

Short_open_tag = on #php支持短标签

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

Fastcgi.impersonate = 1;

Cgi.rfc2616_headers = 1

The following PHP expansion module, choose to open as needed, cancel the preceding semicolon to start the appropriate expansion 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 Yun-wei www.osyunwei.com warm reminder: qihang01 original Content © Copyright, reproduced please specify the source and the original link

Finally, save the exit

4. Configure IIS to support PHP

Opening: 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 mappings" to the right of the point

Request Path: *.php

Module: Fastcgimodule

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

Name: FastCGI

Finally, determine

Dot "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 then select Edit

Monitoring changes to a file: C:\php\php.ini

environment variable, dot next to "..."

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 IIS section in the middle and open the default document

"Add" to the right of the point

Name: index.php

Are you sure

You can see that there are already index.php in the default document

Select the "Move Up" option below the right action to move the index.php to the top

5, test the PHP program is normal operation

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/in the browser

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

6, open Zend Opcache, speed up 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 and you can see Zend Opcache configuration options

Third, the installation of MySQL

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

Select the first item install MySQL products (install MySQL)

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

Select skip Check for update (not recommended), click Next

Select Custom Install

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

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

Next

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

All selected here, install all components

Execute (EXECUTE)

Select "I have read and accept license Terms"

Point installation

Complete

Execute (EXECUTE)

Next

Execute (EXECUTE)

System Yun-wei www.osyunwei.com warm reminder: qihang01 original Content © Copyright, reproduced please specify the source and the original link

Next

Next

Config type (configuration types):

Developer Machine (Development server)

Server Machine (normal server)

Dedicated Machine (dedicated server)

Here, select the second item:server Machine (normal server)

Check "Enable TCP/IP Networking" (Open TCP Network Port)

Port number (ports): 3306

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

Next

MySQL Root Password: enter password

Repeat Password: Repeat Enter password

After setting, click Next

Windows Server name (Windows service name): MySQL56

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

Next

Next

Next

Point 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, return, login to the MySQL console

Exit (Exit)

MySQL Installation complete

Iv. configuration IIS8.5 support pseudo-static

Double-click to install the Microsoft URL Rewrite module Rewrite_x64_zh-cn.msi

Installation

Being installed

Complete

In: the "url rewrite" can be seen in the control Panel \ System and security \ Administrative Tools \internet information Services (IIS) Manager

In: Web site root directory New file web.config, add pseudo static rule code can achieve static web site

At this point, Windows Server R2 iis8.5+php (FastCGI) +mysql environment to complete the tutorial.

Related Article

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.