windows+nginx+php

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" 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章