Install and configure IIS + MySQL + nginx + php7.1.7 and win10nginx in Win10

Source: Internet
Author: User

Install and configure IIS + MySQL + nginx + php7.1.7 and win10nginx in Win10

Environment:

VMWare Workstation Player12

Windows 10 Pro x64

1. Install the system

Vmware uses the fast install method to quickly complete the installation without any configuration.

2. Configure IIS

Enable or disable Windows under programs and functions ". Add the Internet Infomation Services feature. Note that the CGI in the "Application Development function" is deselected by default and must be manually selected.

Note: during actual installation, I added IIS, but it was written at the beginning without any special meaning. Therefore, the port bound to IIS is changed.

About Port: After installation, because 80 is occupied, click "bind" on the right of "Default Web Site" and change the port number to "arbitrary", such as 8800, you can use "localhost: 8800" for future access.

About virtual directories: You can add virtual directories if you need them. After adding the file, access "localhost: 8800/virtual directory name/page", for example, localhost: 8800/myweb/phpinfo. php.

About FastCGI: Select Default Web Site, click handler ing in the functional area, and add module ing.

Put a content in the default/specified path of the website as <? Php phpinfo ();?> File, which can be named phpinfo. php. Start or restart the IIS service. The default path is localhost: 8800/phpinfo. php: Enter localhost: 8800/virtual directory alias/phpinfo. php, indicating that the combination of IIS and PHP is successful

Iii. Compile and install MySQL

Reference example: http://www.bkjia.com/article/95023.htm or something similar

Download the mysql server in the zip format and decompress it to the full English path (Chinese is not tried, so avoid the trouble ). Add environment variables. Add the MySQL Path to the system variable Path.

Create a configuration file named my. ini in the MySQL root directory. The content is as follows:

[Client] port = 3306default-character-set = utf8 [mysqld] port = 3306character_set_server = utf8 # mysql installation/Decompression directory basedir = C: \ Dev \ mysql57 # mysql data directory datadir = C: \ Dev \ mysql57 \ data SQL _mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES
Since it is a configuration, basedir and datadir can be specified according to their own requirements, as long as the configuration file is correctly written. I specified datadir as the basedir path, but the data folder does not exist during decompression, So I manually created a folder. The directory structure is as follows:

Open the cmd command line tool and run it as an administrator.

Run the command cd... to switch to the mysql root directory.

Run the following command:mysqld --initialize --user=mysql --console

At the end of the command execution, mysql will allocate a temporary password. Remember: CZX3ge1kuz) L

Run the following command:mysqld --install MySQL

Installation Complete

net start mysqlStart the service

net stop mysqlStop Service

sc delete MySQL Delete a service (as needed)

After logging on with the initial password, use set password for root @ localhost = password ('new password') to change the password

4. install php

Php can download Non-Thread Safe or Thread Safe. It is unclear about the specific runtime differences. Decompress the package to the specified folder and copy the php file according to the "tutorial" on the Internet. ini-development or php. ini-production: php. and change extension_dir to the ext folder under the php installation directory, as shown in figure

Then follow the instructions (as of the time of writing, I do not know what is required or not) to enable extension = xxxx. To enable extension, remove the colon and save it.

However, some tutorials have suggested that you do not enable the image easily, and an unexpected error may occur. This should be the case. However, because I didn't know how to get started, I can only enable or disable all of them. I will gradually gain experience later.

5. Install nginx

Download nginx and decompress it to the full English directory. Go to the conf folder and modify the nginx. conf file. Compared with php, nginx configuration files are much shorter. Modify location {} and # pass the php scripts to FastCGI... the following location.

Modify the root element to the web path. For example, if the default webpage path is "C: \ www", change it to this one.

Change fastcgi_pass: by default, the port number is definitely changeable.

In cmd command line Administrator running mode, switch cd to the nginx directory and run start nginx to start the service. Since nginx is installed first during actual installation and occupies port 80, running localhost in a browser should display the welcome screen of nginx.

Now, the configuration is complete in windows.

Note: As of the time of writing, the combination of nginx + php and phpinfo have not been correctly displayed. You can fix this tomorrow. It also studies whether or not port 80 is used first.

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.