WINDWS Server R2 Web environment configuration iis7/iis7.5+fastcgi+php 5.6.4+mysql+phpmyadmin

Source: Internet
Author: User
Tags install php mysql version vc9 visual studio 2012 compiler phpmyadmin server port

This article is a summary of the configuration of the Web environment, where PHP runs in a fastcgi manner, which is more performance-oriented. After configuration, our server will be able to run both PHP and. NET programs, which are called all-round servers. All configurations can be increased or decreased according to their actual needs.
Get ready

Prepare the following software versions first: (The package connection has been off the shelf, to download the website by itself)

Php,mysql,phpmyadmin

1. PHP Two modes of operation on Windows: ISAPI and FASTCGI

thread safe and non thread safe

FastCGI execution is performed on a single thread, so there is no need for thread security checks, and the removal of thread safety checks can improve execution efficiency, so if you are executing PHP in FastCGI, it is recommended to download the PHP version of Non-thread safe. Thread safety checks are prepared for the ISAPI way of PHP, because there are many PHP modules that are not thread-safe, so you need to use the thread safe PHP.

In general, if you use iis+fastcgi non trhead safe version, if you are using Apache or ISAPI to choose the thread safe version. So what I'm downloading here is the non Thread safe version.

VC6, VC9 and VC11

The VC6 version was compiled with the Visual Studio 6 compiler, the VC9 version was compiled with the Visual Studio 2008 compiler, and VC11 was made with the Visual Studio 2012 compiler. The new version has improved performance and stability. So your program is relatively new, and can support the high version, it is recommended to choose VC11, and if your program version may be older, support for the new features may not be in place to recommend the choice of VC9 or older VC6 version.

PHP for Windows:


PHP 5.6.4:
VC11 x86 Non Thread Safe
VC11 x86 Thread Safe
VC11 x64 Non Thread Safe
VC11 x64 Thread Safe

PHP 5.5.20

VC11 x86 Non Thread Safe
VC11 x86 Thread Safe
VC11 x64 Non Thread Safe
VC11 x64 Thread Safe

PHP 5.4.36:
VC9 x86 Non Thread Safe
VC9 x86 Thread Safe

PHP 5.3.29:
VC9 x86 Non Thread Safe ZIP, MSI

VC9 x86 Thread Safe ZIP, MSI

2, MySQL version also derived a lot of, as a general personal webmaster words will choose the Community version, this version is free. And I'm showing you the latest version of MySQL version 5.6.22.

3, phpMyAdmin version of the direct selection of the latest can be. phpMyAdmin official website, my demo version is 4.3.5.

Off-topic, the above software official website in the domestic visit is really slow, if encountered can not open, turn to Baidu Bar.

Start installation

1, first install IIS7, see WINDWS Server R2 Web Environment configuration to install IIS.

2, install the Visual C + + plug-in, according to your choice of PHP version and system environment to choose download installation.

The VC9 version requires users to install the Microsoft Visual C + + SP1 Redistributable Package (x86 | x64)

VC11 version requires users to install Visual C + + redistributable for Visual Studio (x86 | x64)

3, install MySQL, you can view WINDWS Server R2 Web Environment configuration of the MySQL 5.6.22 installation configuration.

4, install PHP. There are two ways to configure PHP in IIS7, one for manual configuration and the other with the PHP Manager tool configuration.

(1), manual configuration

First, the downloaded PHP 5.6.4 extracted to the D:\php\ directory, copy php.ini-development to php.ini.

1, set fastcgi Related:

Find the following lines and put the front ";" Remove

Fastcgi.impersonate = 1

Cgi.fix_pathinfo= 1

Cgi.force_redirect = 0

2, specify the PHP extension inventory to put the directory

Find extension_dir= "ext" This line, put the front ";" Remove and change the value to "D:\php\ext"

3, open the corresponding expansion library

By default, many PHP extensions are turned off, and if you need to use these modules you must first turn on the ";" in front of the corresponding module. Remove.

        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_pdo_mysql.dll        extension=php_ Pdo_odbc.dll

4. Support Short Label

Find Short_open_tag = Off modified to Short_open_tag = On

5. Configure Session Storage Directory

Locate the Session.save_path = "/tmp" and modify it to Session.save_path = "d:\tmp" to ensure the D-disk TMP directory.

6. File Upload

file_uploads = on//Open File Upload, default is on pload_tmp_dir = "d:\fileupload\tmp"//Temp file directory upload_max_filesize = 20m//upload maximum file size post_ Max_size = 80m//Here the size should be greater than the value set by Upload_max_filesize, or the upload will fail

7. Set the time zone

Date.timezone =asia/shanghai or PRC

Save, exit.

Open IIS Manager, select the server node

Open handler mappings,

"Add Module Mappings",

Request Path: *.php

Module: Fastcgimodule

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

Name: php-fastcgi

Point "yes" to save.

Double-click "FastCGI Settings",

Select the path, click "Edit",

Click "Add",

Name:php_fcgi_max_requests

value:10000

Finally, "OK".

Create a new index.php file with the contents of

<?phpphpinfo ();? >

Put it in the site directory, run http://localhost/index.php, if it appears as shown, PHP can be run.

(2), through the PHP manager configuration

PHP Manager is a Microsoft-released Configuration tool for managing PHP in IIS, with the following key features:

* Associated PHP and IIS

* Run multiple PHP versions in parallel on the same server, even on the same Web site

* Check PHP Runtime configuration and environment (the output of the Phpinfo () function)

* Configure various PHP settings

* Enable or disable PHP extensions

* Remote Management php.ini PHP configuration file

Phpmanager Official website: http://phpmanager.codeplex.com

Can be downloaded from the official website.

The installation process is simple and does not demonstrate. After installation, an extra icon appears in IIS:

1, first download PHP, and then extract to the directory such as D:\php.

2. Double-click PHP Manager in IIS, which appears as shown by default:

There will be a yellow warning. Click "Register New PHP Version", press the Browse button, select the D:\php\php-cgi.exe file

Are you sure.

Just this step, PHP manager has helped us generate the php.ini configuration file, the mapping of the Fastcgimodule module is automatically added in the handler mapping, the FASTCGI setting has been built, and several common modules have been automatically opened.

If your server requires more than one PHP version, you only need to register "register new PHP versions" multiple times.

Press "Change PHP version" to select PHP.

3.

Here you can directly edit the php.ini file, you can modify the error log storage directory, you can modify the post, upload file size.

4.

Here you can open, close, and add modules.

Is it more convenient than manual setup?

Installation of phpMyAdmin

phpMyAdmin is a web-version online MySQL database management tool that allows administrators to manage MySQL databases using the Web interface.

Unzip the phpMyAdmin to the site directory, because the demo, I put in the default site directory:

Access http://localhost/phpmyadmin/setup/index.php in the browser to install,

Two errors were reported here, the first error means that our server does not support BZIP2 compression and decompression, we only need to open the Php_bz2.dll in php.ini.

The second error resolution is also simple, create a new config folder under the phpMyAdmin root directory, and write permissions to it.

In this way, the two errors are resolved.

Click the "New Server" button to start the installation,

Write a name in the server name: My-mysqlserver,

Server hostname: If the local database is managed, you can write localhost directly, if it is other database server can fill the database IP, I here is the native direct default localhost,

Server port: The default database port is 3306,

Config recognition user name: The default is root, which is the MySQL super user, can administrator it all the database instances below it.

Config authentication method password: Database password

Click "Apply" to finish.

Important: Delete the Config folder under the phpMyAdmin root directory, which is the Config folder we added earlier. If you want to add a server next time, just add the Config folder again and give permission to it.

Access the http://localhost/phpmyadmin/index.php, enter the username and password to manage the MySQL database online.

The phpMyAdmin version is now more and more simple to configure, and features are becoming more powerful, with support for SSL access, unlike the previous version where the configuration file is manually modified.

WINDWS Server R2 Web environment configuration iis7/iis7.5+fastcgi+php 5.6.4+mysql+phpmyadmin

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.