-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathphp_fpm_fastcgi_start.bat
More file actions
57 lines (44 loc) · 1.08 KB
/
php_fpm_fastcgi_start.bat
File metadata and controls
57 lines (44 loc) · 1.08 KB
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
@echo off
echo. windows命令行启动php_fpm服务器进程
echo. 功能:通过批处理文件管理php_fpm服务器的启动、关闭、重启。
echo. author:gwang(mail@wanggangzero.cn)
echo. version:
echo. 1.0.0 Created by gwang 2016.09.02.
echo 正在启动PHP(FastCGI)进程......
:: 初始化
:: 设置进程管理工具目录
set xxfpm=plugin\xxfpm\bin\xxfpm.exe
:: php版本号
set phpver=php-5.3.27
REM set phpver=php-5.6.21-Win32-VC11-x86
REM set phpver=php-7.0.6-Win32-VC14-x64
:: 设置php-cgi程序目录
set php-cgi=php/%phpver%/php-cgi.exe
:: 进程数量
set worker=1
:: 绑定地址
set band=127.0.0.1
:: 端口号
set port=9000
:: 取php-cgi.exe进程数量
set curCount=0
call f_getproccount php-cgi.exe curCount
if %curCount% gtr 0 (
echo 当前已经存在%curCount%个php-cgi进程
)
:: 计算需要启动的进程数量
set /a n=%worker%-%curCount%
:: 打印提示信息
if %n% equ 0 (
echo 不需要额外启动进程了
goto end
) else (
echo 正在重新启动xxfpm进程。。。
satrt /b /wait php_fpm_fastcgi_stop.bat
)
:: 启动php-cgi
plugin\RunHiddenConsole.exe %xxfpm% %php-cgi% -n %worker% -i %band% -p %port%
goto end
:end
:: 还原目录
cd %~dp0