惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
M
MIT News - Artificial intelligence
IT之家
IT之家
博客园 - 【当耐特】
U
Unit 42
云风的 BLOG
云风的 BLOG
L
LangChain Blog
小众软件
小众软件
Microsoft Security Blog
Microsoft Security Blog
B
Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
宝玉的分享
宝玉的分享
N
Netflix TechBlog - Medium

博客园 - 漫漫人生路总会错几步

一种非常巧妙的设计模式 【流量密码】LVS与nginx对比 【架构升华】:数据库是性能的物理终点 【轻量化交付宣言】:DevOps 的本质是工程化,而非工具化 【微服务】是【必须品】吗? 【JWT】真的好吗? PGSQL 1主2从数据库架构与单节点分3库在三块磁盘理论上限畅想(未测试) 相同的硬件,各个数据库专家比赛畅想 maven 原型项目 mysql9.5安装文档 微信图片批量保存的办法 利用WinSW将Nginx 作为可正常启动/停止的windows服务 JPA使用pg数据库时,bool字段不能跨库迁移的解决方案 【ubuntu】程序运行时的任务栏图标 跨网段通信实战(支持静态路由表的家用路由) Linux系统Mariadb初始化相关(ubuntu) springboot 整合webservice 相关说明 tomcat 服务版本内存设置 navicat连接mysql8报错
win平台利用winsw将php-cgi作为系统服务,支持服务的正常启动...
漫漫人生路总会错几步 · 2024-07-28 · via 博客园 - 漫漫人生路总会错几步

首先,需要有winsw, 在GitHub 搜索winsw,点击release 跳转到下载页面选择版本进行下载或点击此链接 Releases · winsw/winsw (github.com)

其次,将winsw 复制到php目录,重命名为 phpcgi-service.exe 并增加配置文件phpcgi-service.xmlstop-cgi.bat ,其中 phpcgi-service.xml 的内容为

<service>
    <id>phpcgi8.3.9</id>
    <name>phpcgi8.3.9</name>
    <description>phpcgi 服务</description>
    <logpath>%BASE%\logs</logpath>
    <logmode>roll</logmode>
    <executable>php-cgi.exe</executable>
    <arguments> -b 127.0.0.1:9000 %BASE%\php.ini</arguments>
    <stopexecutable>stop-cgi.bat</stopexecutable>
</service>

其中,stop-cgi.bat 的代码为:

taskkill /f /im php-cgi.exe

然后,安装服务,使用管理员身份运行cmd,切换到当前目录,运行如下命令即可完成服务的安装,然后就能到系统服务里进行 启动/停止/重启服务 操作了,注意,修改winsw的xml是立即生效的,不需要重新卸载服务在安装

phpcgi-service.exe install

ps: phpcgi-service.xml 中的 %BASE% 为 winsw 可以识别的内置变量,代表winsw.exe 所在的目录,github上的帮助文档不是太全,特此说明