Windows下Nginx及PHP后台启动脚本

start_nginx.bat

1
2
3
4
5
6
7
8
9
10
@echo off
set nginx_home=D:/Server/Nginx/nginx-1.13.8

REM Windows 下无效
REM set PHP_FCGI_CHILDREN=10

echo Starting Nginx...
RunHiddenConsole %nginx_home%/nginx.exe -p %nginx_home%

pause()

start_server.bat

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@echo off
set php_home=D:/Server/PHP/php-7.2.0-nts-Win32-VC15-x64
set nginx_home=D:/Server/Nginx/nginx-1.13.8

REM Windows 下无效
REM set PHP_FCGI_CHILDREN=10

REM 每个进程处理的最大请求数,或设置为 Windows 环境变量
set PHP_FCGI_MAX_REQUESTS=1024

echo Starting PHP FastCGI...
RunHiddenConsole %php_home%/php-cgi.exe -b 127.0.0.1:9000 -c %php_home%/php.ini

echo Starting Nginx...
RunHiddenConsole %nginx_home%/nginx.exe -p %nginx_home%

pause()

stop_server.bat

1
2
3
4
5
6
@echo off
echo Stopping nginx...
taskkill /F /IM nginx.exe > nul
echo Stopping PHP FastCGI...
taskkill /F /IM php-cgi.exe > nul
exit

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :