Home >Backend Development >PHP Tutorial >PHP+NGINX+WIN batch script

PHP+NGINX+WIN batch script

巴扎黑
巴扎黑Original
2016-11-11 09:53:291109browse


@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


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn