Phpnginx is set up in a windows system. nginx is set up in combination with php in a windows system. Preparation: Download nginx? Nginx.orgendownload.html? Download stable version? Php configuration is omitted when you download php or later. pay attention to the following aspects: environment variable configuration, open the corresponding module, and test the configuration, next we will build a record for php nginx in windows.
Build nginx with php in windows.
Preparation:
Download nginx? Http://nginx.org/en/download.html? Download stable version
? Download php5.0 or later versions
IThe configuration of php is omitted here. pay attention to the following aspects: environment variable configuration, open the corresponding module, and then Configure nginx after the test is successful ,? Nginx itself does not support transferring php requests to php by loading them only.
Decompress nginx-0.8.54.zip and open/conf/nginx. conf in d:/nginx to configure server {
Listen 8888; // port server_name localhost; charset utf8; // character set location ~ \. Php $ {root html; // The Project storage directory fastcgi_pass 127.0.0.1: 9000; // It is very important to monitor the port of php-cgi.exe. fastcgi_index index. php; fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name; // It is important to load cgi methods include fastcgi_params ;}}
After configuration, start nginx.exe and view the welcome page in the browser. this is just a step of success,
It is troublesome to start and stop nginx. you can create two bat files.
// Star. the bat path should be 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
?
IIThen configure php. ini so that php can support the cgi mode, so that it can interact with nginx,
Comment out; doc_root =? Probably at line479
Enable_dl = On is probably in line 491.
? Cgi. force_redirect = 0
? Cgi. fix_pathinfo = 1
? Fastcgi. impersonate = 1;
Cgi. rfc2616_headers = 1
3. start php-cgi.exe in the command line.
?
D: \ php> php-cgi.exe-B listen 0.0.01: 9000-q the port here should be the same as the listening port configured in nginx.
?
?
?
?