PHP Nginx to build records under Windows system
Build Nginx in conjunction with PHP under Windows System.
Get ready:
Download nginx http://nginx.org/en/download.html? Download stable version
? php5.0 and above version download
a configuration php in here is omitted, the main attention to a few aspects: the configuration of the environment variable, open the corresponding module, test success, the next is to configure Nginx,? Nginx itself does not support PHP only by loading the PHP request to the PHP.
unzip the downloaded nginx-0.8.54.zip under D:/nginx to open the/conf/nginx.conf configuration inside server {
Listen 8888;//port server_name localhost; CharSet utf8;//Character Set location ~ \.php$ { root html;//Project storage directory Fastcgi_pass 127.0.0.1:9000;// Listening to Php-cgi.exe ports is important Fastcgi_index index.php;fastcgi_param script_filename $document _root$fastcgi _script_name; Loading CGI mode is important include fastcgi_params; }}
After configuring the start Nginx.exe in the browser view appears welcome page, here is just a successful step,
Nginx start and stop more trouble, can build two bat files
Star.bat path to correct @echo Offecho starting nginx...d:/nginx/nginx.exe//shartdown.bat @echo Offecho stopping nginx ... taskkill/f/im nginx.exe > Nulecho stopping PHP fastcgi...taskkill/f/im php-cgi.exe > Nulexit
?
two then configure PHP.ini to enable PHP to support the CGI mode, so that you can interact with Nginx,
First comment out; doc_root=, probably in line479.
Then open: Enable_dl = on about line 491
? cgi.force_redirect = 0
? cgi.fix_pathinfo=1
? fastcgi.impersonate = 1;
Cgi.rfc2616_headers = 1
Three last to start php-cgi.exe under the command line
?
D:\php>php-cgi.exe-b 1270.0.01:9000-q The port here is the same as the monitoring port configured in Nginx.
?
?
?
?