For more information about how to configure the Nginx + php environment in Windows 7, see.
I. preparations:
OS: Windows 7 SP1
Nginx: nginx-1.3.5
Php: php-5.4.6
Decompress php-5.4.6-win32-vc9-x86.zip to D: php and change php. ini-production to php. ini.
3. Decompress nginx-1.3.5.zip to D: nginx and edit the D: nginxconfnginx. conf file:
Location /{
Root html;
Index index.html index.htm index. php; # Add a PHP Homepage
}
# Cancel the following comments and modify them:
Location ~ . Php $ {
Root html;
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
# Html indicates the website directory, which must be consistent with that in root.
Fastcgi_param SCRIPT_FILENAME html $ fastcgi_script_name;
Include fastcgi_params;
}
4. Add a php-cgi.cmd file in D: nginx and write content:
"D: phpphp-cgi.exe"-B 127.0.0.1: 9000-c "D: phpphp. ini"
5. Add the index. php file of phpinfo in the d: nginxhtml folder and write the following content:
1 <? Php
2 phpinfo ();
3?> 6. Run D: nginxphp-cgi.cmd and D: nginxnginx.exe and open: http: // localhost/index. php. Have you seen the familiar phpinfo page!
VII. nginx basic commands:
Start nginx: start nginx
Nginx-s stop: stop nginx
Nginx-s quit: Exit nginx