6步在Windows中安装Nginx,运行PHP
6步轻松完成:
1.安装nginx-0.8.20 for windows
2.安装PHP 5.3.2
3.安装iis fast cgi (安装php时提示你要安装iis fast cgi)
4.nginx.conf配置
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
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;
}
5. 运行 nginx.exe
6. 运行php-cgi.exe:
在cmd命令行中输入: php-cgi.exe -b 127.0.0.1:9000 -q
(关闭cmd窗口,php-cgi.exe也会随之关闭)