Home >Backend Development >PHP Tutorial >PHP+NGINX+WIN batch script
@ECHO OFF COLOR 0A TITLE Nginx PHP 启动 TASKLIST|FINDSTR nginx.exe && TASKKILL /F /IM nginx.exe TASKLIST|FINDSTR php-cgi.exe && TASKKILL /F /IM php-cgi.exe GOTO startnginx :startnginx ECHO. ECHO.Start Nginx D: CD D:\Program Files\nginx-1.8.0\ start nginx ECHO.StartNginxOK GOTO startphpcgi :startphpcgi ECHO. ECHO.启动php-cgi...... D: CD D:\Program Files\php-5.6.8-Win32-VC11-x64\ 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:\Program Files\php-5.6.8-Win32-VC11-x64\php.ini",0 >>start_fastcgi.vbs start_fastcgi.vbs del start_fastcgi.vbs ECHO.StartPhpcgiOK PING 127.0.0.1 > nul EXIT
Regarding path configuration, environment variable configuration can be done in advance, or you can add environment variable setting path configuration language to this basic line