window下的nginx + php 批处理 开启和关闭 方便操作
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
===================================================
@
echo
off
rem 当前bat的作用
echo
==================begin========================
cls
SET NGINX_PATH=D:
SET NGINX_DIR=D:\nginx-1.5.7\
color 0a
TITLE Nginx 管理程序控制面板
CLS
ECHO.
ECHO. * Nginx 管理程序 *
ECHO.
:MENU
ECHO. * nginx 进程list *
tasklist|findstr
/i
"nginx.exe"
ECHO.
ECHO. [1] 启动Nginx
ECHO. [2] 关闭Nginx
ECHO. [3] 重启Nginx
ECHO. [4] 退 出
ECHO.
ECHO.请输入选择项目的序号:
set
/p
ID=
IF
"%id%"
==
"1"
GOTO start
IF
"%id%"
==
"2"
GOTO stop
IF
"%id%"
==
"3"
GOTO restart
IF
"%id%"
==
"4"
EXIT
PAUSE
:start
call :startNginx
GOTO MENU
:stop
call :shutdownNginx
GOTO MENU
:restart
call :shutdownNginx
call :startNginx
GOTO MENU
:shutdownNginx
ECHO.
ECHO.关闭Nginx......
taskkill
/F
/IM
nginx.exe > nul
ECHO.OK,关闭所有nginx 进程
goto :eof
:startNginx
ECHO.
ECHO.启动Nginx......
IF NOT EXIST
"%NGINX_DIR%nginx.exe"
ECHO
"%NGINX_DIR%nginx.exe"
不存在
%NGINX_PATH%
cd
"%NGINX_DIR%"
IF EXIST
"%NGINX_DIR%nginx.exe"
(
echo
"start '' nginx.exe"
start
""
nginx.exe
)
ECHO.OK
goto :eof
|
php批处理 php-cgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
@
echo
off
ECHO.
ECHO. [1] 启动php
ECHO. [2] 关闭php
ECHO.
ECHO.请输入选择项目的序号:
set
/p
ID=
IF
"%id%"
==
"1"
GOTO start
IF
"%id%"
==
"2"
GOTO stop
PAUSE
:stop
ECHO.
ECHO.关闭php
taskkill
/f
/im
php-cgi.exe > nul
ECHO.OK,关闭所有php 进程
goto :eof
:start
ECHO.
echo
Starting PHP FastCGI...
start d:
/php-5
.2.14-Win32
/php-cgi
.exe -b 127.0.0.1:9000 -c c:
/window/php
.ini
|
本文转自 cs312779641 51CTO博客,原文链接:http://blog.51cto.com/chenhao6/1353062