windows bat启动/停止 nginx、php-cgi-2023年7月9日

windows bat启动nginx、php-cgi-2023年7月9日


日期:2023年7月9日

bat启动代码

@echo off
::启动环境 2023年7月9日农历五月廿二
if "%1" == "h" goto begin
mshta Vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
::获取当前路径。运行结果:以\反斜线结尾
set currentDir=%~dp0
::nginx目录
set nginxRoot=%currentDir%nginx\
cd %nginxRoot%
start nginx
::php所在目录
set phpRoot=%currentDir%php\
::php.ini所在目录
set phpIniExe=%currentDir%php\php.ini
::运行php-cgi
cd %phpRoot%
php-cgi -b 127.0.0.1:9000 -c %phpIniExe%

bat停止代码

@echo off
::停止环境 2023年7月9日农历五月廿二
::启动并隐藏cmd黑窗口
if "%1" == "h" goto begin
mshta Vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
::获取当前路径。运行结果:以\反斜线结尾
set currentDir=%~dp0
::停止nginx进程
taskkill /f /im nginx.exe
::停止php-cgi进程
taskkill /f /im php-cgi.exe

内容绝对原创,希望对您有帮助。您的打赏,是让我持续更新的牛奶和面包
在这里插入图片描述

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值