首页 > 其他分享 >webman:安装/创建项目(v1.5.7)

webman:安装/创建项目(v1.5.7)

时间:2023-08-19 09:13:38浏览次数:47  
标签:start webman 创建 liuhongdi v1.5 0.0 php 8787

一,官方文档:

1,官方站:

https://www.workerman.net/webman

2,安装文档:

https://www.workerman.net/doc/webman/install.html

二,准备安装环境:

1,需求

环境需求

2,查看本地环境:php:

liuhongdi@lhdpc:~$ /usr/local/soft/php8/bin/php --version
PHP 8.1.1 (cli) (built: Dec 20 2021 16:12:16) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.1, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.1, Copyright (c), by Zend Technologies

3,查看本地环境:composer:

liuhongdi@lhdpc:~$ /usr/local/bin/composer --version
Composer version 2.5.8 2023-06-09 17:13:21

三,创建项目:

1,用命令创建

liuhongdi@lhdpc:/data/webman$ composer create-project workerman/webman imageadmin

2,调试方式启动

liuhongdi@lhdpc:/data/webman/imageadmin$ php start.php start
Workerman[start.php] start in DEBUG 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]            
--------------------------------------------------------------------------------------------------
Press Ctrl+C to stop. Start success.

3,查看效果:

访问:

http://0.0.0.0:8787/

如图:

4,以生产方式(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.

查看端口:

liuhongdi@lhdpc:/data/webman/imageadmin$ ss -lntp | grep 8787
LISTEN 0      4096         0.0.0.0:8787       0.0.0.0:*    users:(("php",pid=2223,fd=6),("php",pid=2222,fd=6),("php",pid=2221,fd=6),("php",pid=2220,fd=6),("php",pid=2219,fd=6),("php",pid=2218,fd=6),("php",pid=2217,fd=6),("php",pid=2216,fd=6),("php",pid=2215,fd=6))

查看进程:

liuhongdi@lhdpc:/data/webman/imageadmin$ ps auxfww
…
liuhong+    2215  0.0  0.3 416212 15564 ?        S    20:58   0:00 WorkerMan: master process  start_file=/data/webman/imageadmin/start.php
liuhong+    2216  0.0  0.4 416212 17724 ?        S    20:58   0:00  \_ WorkerMan: worker process  webman http://0.0.0.0:8787
liuhong+    2217  0.0  0.4 416212 18472 ?        S    20:58   0:00  \_ WorkerMan: worker process  webman http://0.0.0.0:8787
liuhong+    2218  0.0  0.4 416212 17912 ?        S    20:58   0:00  \_ WorkerMan: worker process  webman http://0.0.0.0:8787
liuhong+    2219  0.0  0.4 416212 17576 ?        S    20:58   0:00  \_ WorkerMan: worker process  webman http://0.0.0.0:8787
liuhong+    2220  0.0  0.4 416212 16184 ?        S    20:58   0:00  \_ WorkerMan: worker process  webman http://0.0.0.0:8787
liuhong+    2221  0.0  0.4 416212 17376 ?        S    20:58   0:00  \_ WorkerMan: worker process  webman http://0.0.0.0:8787
liuhong+    2222  0.0  0.4 416212 17136 ?        S    20:58   0:00  \_ WorkerMan: worker process  webman http://0.0.0.0:8787
liuhong+    2223  0.0  0.4 416212 17260 ?        S    20:58   0:00  \_ WorkerMan: worker process  webman http://0.0.0.0:8787
liuhong+    2224  0.0  0.4 416212 17492 ?        S    20:58   0:00  \_ WorkerMan: worker process  monitor none

5,停止进程:

liuhongdi@lhdpc:/data/webman/imageadmin$ php start.php stop
Workerman[start.php] stop 
Workerman[start.php] is stopping ...
Workerman[start.php] stop success

说明:刘宏缔的架构森林—专注it技术的博客,
网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/08/18/webman-an-zhuang-chuang-jian-xiang-mu-v1-5-7/
代码: https://github.com/liuhongdi/ 或 https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: [email protected]

四,查看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
type     : library
...

标签:start,webman,创建,liuhongdi,v1.5,0.0,php,8787
From: https://www.cnblogs.com/architectforest/p/17642040.html

相关文章

  • webman:修改默认页面(v1.5.7)
    一,默认页面的内容:说明:代码位于app/IndexController.php参考这个文档:https://www.workerman.net/doc/webman/route.html原始代码:显示了README.md这个文件的内容12345678910classIndexController{    publicfunctionindex(Request$reques......
  • webman:管理命令(v1.5.7)
     一,启动和停止1,启动#-d:以daemon方式启动,用于生产环境liuhongdi@lhdpc:/data/webman/imageadmin$phpstart.phpstart-dWorkerman[start.php]startinDAEMONmode-------------------------------------------WORKERMAN--------------------------------------......
  • webman:配置路由(v1.5.7)
     一,官方文档地址:https://www.workerman.net/doc/webman/route.html二,php代码:config/route.php1234567891011121314151617181920<?php useWebman\Route; //指定默认页面Route::get('/',[app\controller\IndexController::class......
  • webman:返回统一格式的json(v1.5.7)
     一,php代码:1,类代码:app/result/Result.php1234567891011121314151617181920212223242526272829303132333435<?php/*   统一格式的返回json数据*/namespaceapp\result; classResult{    //success:code......
  • 创建一个简单的命令
    创建一个简单的命令设计命令首先,你应该已经为这个命令想好了名字。在这个片段中,我们将使用/kit这个命令的例子。然而,这可以用你在自己的插件中选择使用的任何命令来代替。建议为每个命令创建一个新的类,这样更有条理。你的类必须实现CommandExecutor接口。该类文件可能看起......
  • 【Oracle RAC Database】创建ASM磁盘组与RAC Database
    [grid@node01~]$asmca[oracle@node01~]$dbca[grid@node01~]$crsctlstatusres-t--------------------------------------------------------------------------------NAMETARGETSTATESERVERSTATE_DETAILS---------......
  • 利用 AI 视频模板创建器彻底改变内容创建:数字时代的游戏规则改变者
    介绍在不断发展的数字环境中,内容创建已成为企业、营销人员和个人的关键方面。随着注意力的缩短和对视觉吸引力内容需求的增加,对高效和有效的内容创建工具的需求激增。人工智能(AI)已成为一项突破性技术,它彻底改变了内容创作,尤其是随着人工智能视频模板创作者的出现。在这篇博文中......
  • C# 特性的创建与使用
    1、先创建一些特性以及一个示例类//应用的目标类型:类,属性,或者其他,是否对同一个目标进行多次应用[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method,AllowMultiple=false)]classDoseInterstingThingAttribute:Attribute{publici......
  • .net7 创建windows后台服务
    开发语言:C#运行时:.net7开发环境:visualstudio2022微软官方文档:https://learn.microsoft.com/zh-cn/dotnet/core/extensions/windows-service?pivots=dotnet-7-0最近公司需要使用后台调度服务定时拉取业务数据并推送至第三方,原本是直接使用aps.netcore应用程序部署在IIS上......
  • 【Oracle RAC Database】通过ASMLIB创建ASM DISK
    [root@node01~]#groupadd-g1200dba[root@node01~]#groupadd-g1201oinstall[root@node01~]#groupadd-g1202asmadmin[root@node01~]#groupadd-g1203asmdba[root@node01~]#useradd-u1100-goinstall-Gasmadmin,asmdba,dbagrid[root@node01~]......