Operating system: Win7 64-bit
Database: MySQL (Installation configuration not detailed here)
Php5.5.30ns (Installation configuration not detailed here)
The crux of the problem is that the Nginx server is associated with PHP
First, the Server software nginx-1.11.4
Http://nginx.org/en/download.html
Download Windows version Nginx and unzip, open Nginx.exe cmd input start nginx. Open the browser input localhost to see the following interface is indicated, NGINX installation success!
(note 80 port occupancy issues, which can be configured in the nginx.conf file under the Conf folder ) Second, PHP associated Nginx server(Nginx Server establishes communication with the Php-cgi.exe process via TCP port 127.0.0.1:9000)Configuration according to nginx.conf: #location ~ \.php$ {
# root www;
# Fastcgi_pass 127.0.0.1:9000;
# Fastcgi_index index.php;
# Fastcgi_param Script_filename $document _root$fastcgi_script_name;
# include Fastcgi_params;
#} Configure PHP to open the database extension Extension=php_mysql.dll
Extension=php_mysqli.dll makes PHP run in CGI, on 127.0.0.1:9000. Third, in the Nginx configuration file, configure the PathInfo access mode, so that the Web server support thinkphp
Location ~ ^.+\. php {root html; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_split_path_info ^ (. +\.php) (. *) $; Fastcgi_param script_filename $document _root$fastcgi_script_name; This is going to be your own website path fastcgi_param path_info $fastcgi _path_info; Fastcgi_param path_translated $document _root$fastcgi_path_info; include Fastcgi_params; # The original configuration commented out # location ~. *\.php?$ {# root HTML; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param Script_filename $document _root$ Fastcgi_script_name; # include Fastcgi_params; # }
WNMP Configuration (windows+nginx+mysql+php development environment)