注意
php
打包后的文件目前只支持运行在x86_64架构的linux系统上,不支持windows和mac系统
需要关闭php.ini的phar配置选项,既设置 phar.readonly = 0
打包后的项目不支持reload,更新代码需要restart重启
二进制文件无需php环境也能在linux系统运行起来。
phar打包需要php环境
安装
composer require webman/console
配置文件
php
config/plugin/webman/console/app.php
禁用函数检查
php
检查禁用函数
curl -Ss https://www.workerman.net/webman/check | php
方法一
php webman fix-disable-functions
不好用的话安装下面这个
composer require webman/console ^v1.2.35
方法二
curl -Ss https://www.workerman.net/webman/fix-disable-functions | php
上传文件到public目录
php
config/app.php
'public_path' => base_path(false) . DIRECTORY_SEPARATOR . 'public',
二进制打包
php
运行命令
php webman build:bin
指定php版本打包
php webman build:bin 8.1
启动
php
调试方式运行
./webman.bin start
守护进程方式运行
./webman.bin start -d
phar打包
php
php webman build:phar
启动
php
启动
php webman.phar start 或 php webman.phar start -d
停止
php webman.phar stop
查看状态
php webman.phar status
查看连接状态
php webman.phar connections
重启
php webman.phar restart 或 php webman.phar restart -d