Batch Processing code for Nginx + PHP (FastCGI) Management in Windows

Source: Internet
Author: User

Note: Modify the values of several variables in the Start header.
Program code Copy codeThe Code is as follows: SET NGINX_PATH = D:
SET NGINX_DIR = D: \ nginx-0.7.63 \
SET PHP_DIR = D: \ PHP \
++ Code
Cls
@ ECHO OFF
SET NGINX_PATH = D:
SET NGINX_DIR = D: \ nginx-0.7.63 \
SET PHP_DIR = D: \ PHP \
Color 0a
TITLE Nginx + PHP hypervisor (niming http://www.link888.cn)
GOTO MENU
: MENU
CLS
ECHO.
ECHO. ******* Nginx + PHP hypervisor ******
ECHO .**
ECHO. * 1 start Nginx *
ECHO .**
ECHO. * 2 disable Nginx *
ECHO .**
ECHO. * 3 restart Nginx *
ECHO .**
ECHO. * 4 start php-cgi *
ECHO .**
ECHO. * 5 disable php-cgi *
ECHO .**
ECHO. * 6 restart php-cgi *
ECHO .**
ECHO. * 7 return *
ECHO .**
ECHO .************************
ECHO.
ECHO. Enter the serial number of the selected project:
Set/p ID =
IF "% id %" = "1" GOTO cmd1
IF "% id %" = "2" GOTO cmd2
IF "% id %" = "3" GOTO cmd3
IF "% id %" = "4" GOTO limit 4
IF "% id %" = "5" GOTO limit 5
IF "% id %" = "6" GOTO limit 6
IF "% id %" = "7" EXIT
PAUSE
: Cmd1
ECHO.
ECHO. Start Nginx ......
If not exist does nginx_dir1_nginx.exe ECHO does not exist nginx_dir1_nginx.exe
% NGINX_PATH %
Cd % NGINX_DIR %
If exist then nginx_dir=nginx.exe start then nginx_dir=nginx.exe
ECHO. OK
PAUSE
GOTO MENU
: Cmd2
ECHO.
ECHO. Disable Nginx ......
Taskkill/F/IM nginx.exe> nul
ECHO. OK
PAUSE
GOTO MENU
: Cmd3
ECHO.
ECHO. Disable Nginx ......
Taskkill/F/IM nginx.exe> nul
ECHO. OK
GOTO cmd1
GOTO MENU
: Limit 4
ECHO.
ECHO. Start php-cgi ......
If not exist does php_dir1_php-cgi.exe ECHO does not exist php_dir1_php-cgi.exe
Echo set wscriptObj = CreateObject ("Wscript. Shell")> start_fastcgi.vbs
Echo wscriptObj. run "Maid php_dir1_php-cgi.exe-B 127.0.0.1: 9000", 0> start_fastcgi.vbs
Start_fastcgi.vbs
Del start_fastcgi.vbs
ECHO. OK
PAUSE
GOTO MENU
: Limit 5
ECHO.
ECHO. Disable php-cgi ......
Taskkill/F/IM php-cgi.exe> nul
ECHO. OK
PAUSE
GOTO MENU
: Limit 6
ECHO.
ECHO. Disable php-cgi ......
Taskkill/F/IM php-cgi.exe> nul
ECHO. OK
GOTO lifecycle 4
GOTO MENU

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.