wnp
程序员文章站
2024-03-19 12:30:16
...
@ECHO OFF
COLOR 0A
TITLE Nginx PHP 启动
::检查当前是否运行nginx 和 php-cgi 如果运行 则关闭
TASKLIST|FINDSTR nginx.exe && TASKKILL /F /IM nginx.exe
TASKLIST|FINDSTR php-cgi.exe && TASKKILL /F /IM php-cgi.exe
GOTO startnginx
::启动nginx
:startnginx
ECHO.
ECHO.Start Nginx
D:
CD D:\wnp\nginx-1.8.0\
start nginx
ECHO.StartNginxOK
GOTO startphpcgi
::启动php-cgi
:startphpcgi
ECHO.
ECHO.启动php-cgi 7......
D:
CD D:\wnp\php-7.2.0-nts-Win32-VC15-x86\
IF NOT EXIST %PHP_CGI% ECHO %PHP_CGI%不存在
ECHO set wscriptObj = CreateObject("Wscript.Shell") >start_fastcgi.vbs
ECHO wscriptObj.run "php-cgi.exe -b 127.0.0.1:9001 -c D:\wnp\php-7.2.0-nts-Win32-VC15-x86\php.ini",0 >>start_fastcgi.vbs
start_fastcgi.vbs
del start_fastcgi.vbs
ECHO.StartPhpcgiOK
::延迟关闭
PING 127.0.0.1 > nul
EXIT