1:首先启动php-cgi.exe,端口要和nginx 配置一致 : php-cgi.exe -b 127.0.0.1:9009
2:配置nginx.conf
server{
listen 80;
server_name www.noobay.com noobay.com;
#php项目路径
root D:\webroot\www.noobay.com;
index index.html index.htm index.php;
#伪静态规则
include noobay.conf;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9009; //php-cgi监听端口
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}