一,启动和停止
1,启动
#-d: 以daemon方式启动,用于生产环境
liuhongdi@lhdpc:/data/webman/imageadmin$ php start.php start -d
Workerman[start.php] start in DAEMON mode
------------------------------------------- WORKERMAN --------------------------------------------
Workerman version:4.1.13 PHP version:8.1.1 Event-Loop:\Workerman\Events\Select
-------------------------------------------- WORKERS ---------------------------------------------
proto user worker listen processes status
tcp liuhongdi webman http://0.0.0.0:8787 8 [OK]
tcp liuhongdi monitor none 1 [OK]
--------------------------------------------------------------------------------------------------
Input "php start.php stop" to stop. Start success.
2,停止:
liuhongdi@lhdpc:/data/webman/imageadmin$ php start.php stop
Workerman[start.php] stop
Workerman[start.php] is stopping ...
Workerman[start.php] stop success
二,重启webman:
liuhongdi@lhdpc:/data/webman/imageadmin$ php start.php restart -d
Workerman[start.php] restart
Workerman[start.php] is stopping ...
Workerman[start.php] stop success
------------------------------------------- WORKERMAN --------------------------------------------
Workerman version:4.1.13 PHP version:8.1.1 Event-Loop:\Workerman\Events\Select
-------------------------------------------- WORKERS ---------------------------------------------
proto user worker listen processes status
tcp liuhongdi webman http://0.0.0.0:8787 8 [OK]
tcp liuhongdi monitor none 1 [OK]
--------------------------------------------------------------------------------------------------
Input "php start.php stop" to stop. Start success.
三,使代码修改后生效:
两种做法都可以:
1,restart
liuhongdi@lhdpc:/data/webman/imageadmin$ php start.php restart -d
Workerman[start.php] restart
Workerman[start.php] is stopping ...
Workerman[start.php] stop success
------------------------------------------- WORKERMAN --------------------------------------------
Workerman version:4.1.13 PHP version:8.1.1 Event-Loop:\Workerman\Events\Select
-------------------------------------------- WORKERS ---------------------------------------------
proto user worker listen processes status
tcp liuhongdi webman http://0.0.0.0:8787 8 [OK]
tcp liuhongdi monitor none 1 [OK]
--------------------------------------------------------------------------------------------------
Input "php start.php stop" to stop. Start success.
2,reload
liuhongdi@lhdpc:/data/webman/imageadmin$ php start.php reload
Workerman[start.php] reload
四,查看运行状态
liuhongdi@lhdpc:/data/webman/imageadmin$ php start.php status
Workerman[start.php] status
----------------------------------------------GLOBAL STATUS----------------------------------------------------
Workerman version:4.1.13 PHP version:8.1.1
start time:2023-08-17 21:36:03 run 0 days 0 hours
load average: 0.26, 0.63, 0.61 event-loop:\Workerman\Events\Select
2 workers 9 processes
worker_name exit_status exit_count
webman 0 0
monitor 0 0
----------------------------------------------PROCESS STATUS---------------------------------------------------
pid memory listening worker_name connections send_fail timers total_request qps status
2739 0.81M http://0.0.0.0:8787 webman 0 0 0 0 0 [idle]
2740 0.81M http://0.0.0.0:8787 webman 0 0 0 0 0 [idle]
2741 0.81M http://0.0.0.0:8787 webman 0 0 0 0 0 [idle]
2742 0.81M http://0.0.0.0:8787 webman 0 0 0 0 0 [idle]
2743 0.81M http://0.0.0.0:8787 webman 0 0 0 0 0 [idle]
2744 0.76M http://0.0.0.0:8787 webman 2 0 0 3 0 [idle]
2745 0.74M http://0.0.0.0:8787 webman 0 0 0 0 0 [idle]
2746 0.74M http://0.0.0.0:8787 webman 0 0 0 0 0 [idle]
2747 0.74M none monitor 0 0 1 0 0 [idle]
----------------------------------------------PROCESS STATUS---------------------------------------------------
说明:刘宏缔的架构森林—专注it技术的博客,
网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/08/18/webman-guan-li-ming-ling-v1-5-7/
代码: https://github.com/liuhongdi/ 或 https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: [email protected]
五,查看已建立的连接:
liuhongdi@lhdpc:/data/webman/imageadmin$ php start.php connections
Workerman[start.php] connections
--------------------------------------------------------------------- WORKERMAN CONNECTION STATUS --------------------------------------------------------------------------------
PID Worker CID Trans Protocol ipv4 ipv6 Recv-Q Send-Q Bytes-R Bytes-W Status Local Address Foreign Address
3060 webman 1 tcp Http 1 0 0B 0B 495B 238B ESTABLISHED 192.168.219.6:8787 192.168.219.1:57665
六,查看webman的版本:
liuhongdi@lhdpc:/data/webman/imageadmin$ composer show workerman/webman-framework
name : workerman/webman-framework
descrip. : High performance HTTP Service Framework.
keywords : High Performance, http service
versions : * v1.5.7
...
标签:start,webman,0.0,Workerman,命令,v1.5,liuhongdi,php
From: https://www.cnblogs.com/architectforest/p/17642047.html