First, download the necessary things
1.nginx:http://nginx.org/en/download.html
2.php:http://php.net/downloads.php
3.mysql: (for the time being)
Second, installation and configuration
1. Configure PHP:
Rename the php.ini-development to php.ini and modify the configuration in it.
ENABLE_DL = On
Cgi.force_redirect = 0
Cgi.fix_pathinfo=1
Fastcgi.impersonate = 1
Cgi.rfc2616_headers = 1
Extension_dir = "./ext" (write absolute path also line)
2. Configure Nginx (mainly configure it to support PHP) Note the $document_root variable in this area, it corresponds to the root parameter value, if we do not define the root parameter or the root comment out, when accessing PHP,
No input file specified will appear on the page. Tips.
Location ~ \.php$ { root f:/wnmp/nginx-1.10.2/html; #这是目录路径 (default is the HTML directory that writes Nginx, "Welcome to Nginx when accessed" ") fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; # include Fastcgi_params; }
(1). Note that the $document_root here is the root parameter value that is the path above, if there is no definition, or comments, when accessing PHP, the page prompts no input file specified
Location/{ root f:/wnmp/nginx-1.10.2/html; Index index.php;# add index.php here for Nginx to recognize the PHP script }
Build Nginx+php+mysql Environment under Windows