您的当前位置:首页>全部文章>文章详情

thinkphp中常用的Workerman/消息队列/定时器命令

发表于:2023-03-23 11:56:34浏览:196次TAG: #ThinkPHP #队列 #定时任务 #长连接 #Workerman

环境:linux
框架:thinkphp
指定执行用户:sudo -u www
指定PHP版本:/www/server/php/73/bin/php
启动若是在supervisord进程管理器执行,禁止在命令中指定执行用户和php版本,在添加的时候就会给你指定

消息队列

启动

/www/server/php/73/bin/php think queue:listen --queue 任务名  --timeout 600 --memory 256

Workerman

后台启动

sudo -u www /www/server/php/73/bin/php think workerman:gateway -d

调试启动

sudo -u www /www/server/php/73/bin/php think workerman:gateway

平滑重启

sudo -u www /www/server/php/73/bin/php think workerman:gateway reload

关闭

sudo -u www /www/server/php/73/bin/php think workerman:gateway stop

查看状态

sudo -u www /www/server/php/73/bin/php think workerman:gateway status

定时任务

后台启动

sudo -u www /www/server/php/73/bin/php think timer start --d

调试启动

sudo -u www /www/server/php/73/bin/php think timer start

平滑重启

sudo -u www /www/server/php/73/bin/php think timer restart

关闭

sudo -u www /www/server/php/73/bin/php think timer stop

查看状态

sudo -u www /www/server/php/73/bin/php think timer status