I. Resources:
Nginx: http://nginx.org/en/download.html
PHP: http://windows.php.net/download/
Ii. Directory Planning
D:/PHP
D:/PHP/PhP5
D:/PHP/nginx
D:/PHP/WWW
D:/PHP/tmp/session
D:/PHP/tmp/fileupload
Iii. nginx Configuration
And PHP combination, mainly pay attention to, see this link: http://blog.csdn.net/kimsoft/article/details/7724449
Basically
location / { root d:/php/www; index index.html index.htm index.php; } location ~ \.php$ { root d:/php/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; }
Iv. PHP configuration
CD/d:/PHP/PhP5
Copy PHP. ini-development PHP. ini # copy a master configuration file
PHP configuration can refer to here: http://www.leapsoul.cn /? P = 695
CGI. fix_pathinfo = 1
Extension_dir = "D:/PHP/PhP5/EXT"
Extension = php_curl.dll
Extension = php_gd2.dll
Extension = php_mbstring.dll
Extension = php_mysql.dll
Extension = php_pdo_mysql.dll
Extension = php_pdo_odbc.dll
Extension = php_xmlrpc.dll
Session. save_path = "D:/PHP/tmp/session"
Upload_tmp_dir = "D:/PHP/tmp/fileupload"
Date. timezone = Asia/Shanghai
5. nginx + PhP command combination
See here: http://koda.iteye.com/blog/601231
Write two scripts:
Startnginxphp5.bat
@echo offecho Starting PHP FastCGI... RunHiddenConsole d:/php/php5/php-cgi.exe -b 127.0.0.1:9000 -c d:/php/php5/php.ini echo Starting nginx...cd /d d:/php/nginx/d:/php/nginx/nginx.exepause
Stopnginxphp5.bat
@echo offecho Stopping nginx... taskkill /F /IM nginx.exe > nulecho Stopping PHP FastCGI... taskkill /F /IM php-cgi.exe > nul exit
Vi. Test
<?php phpinfo(); ?>