win10 启动nginx php-fpm的bat脚本

运行环境

版本PHP7.4 NGINX1.16稳定版,系统windows。

启动脚本

@echo off
ECHO Starting PHP FastCGI...
set PATH=c:\php74;%PATH%
taskkill /fi "imagename eq php-cgi.exe"

c:/RunHiddenConsole/RunHiddenConsole.exe c:/php74/php-cgi.exe -b 127.0.0.1:9000
rem RunHiddenConsole.exe D:\wamp64\bin\php\php5.6.25\php-cgi.exe -b 127.0.0.1:9001
rem RunHiddenConsole.exe D:\wamp64\bin\php\php5.6.25\php-cgi.exe -b 127.0.0.1:9002
rem RunHiddenConsole.exe D:\wamp64\bin\php\php5.6.25\php-cgi.exe -b 127.0.0.1:9003

rem tasklist /fi "imagename eq nginx.exe"
taskkill /F /fi "imagename eq nginx.exe"
start nginx

保存bat文件到nginx的目录,启动即可。

下载地址

RunHiddenConsole 下载 https://www.nginx.com/resources/wiki/start/topics/examples/phpfastcgionwindows/

你可能感兴趣的:(windows,bat)