windows+nginx+php

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/kongdeqian1988/article/details/78708263

cd E:\AppServ\nginx-1.13.7

nginx.exe  //启动nginx,启动后可关闭cmd窗口

修改nginx.conf

location ~ \.php$ {
       root           html;
       fastcgi_pass   127.0.0.1:9001;
       fastcgi_index  index.php;
       include fastcgi.conf;
 }


nginx.exe -t  //检查配置文件

nginx.exe -s reload //重载配置文件


cd  E:\AppServ\php71

php-cgi.exe -b 127.0.0.1:9001  //启动php,并绑定9001端口,如果php5的话请加-c 配置文件参数


启动脚本nginx_start.bat

e:
cd E:\AppServ\nginx-1.13.7
echo "nginx is starting"  
start "" "nginx.exe"  
exit


停止脚本nginx_stop.bat

e:
cd E:\AppServ\nginx-1.13.7
tasklist | findstr /i "nginx.exe"  
echo "nginx is running, stopping..."  
rem nginx -s stop  
TASKKILL /F /IM nginx.exe /T  
echo "stop ok" 


猜你喜欢

转载自blog.csdn.net/kongdeqian1988/article/details/78708263