一,官方文档地址:
https://webman.workerman.net/doc/zh-cn/others/bin.html
二,报错的处理:
1,
$ php webman build:bin
Route /delete ["app\\controller\\LoginController","delete"] is not callableIn BuildPharCommand.php line 142:The 'phar.readonly' is 'On', build phar must setting it 'Off' or exec with 'php -d phar.readonly=0 ./webman build:bin' build:bin [<version>]
解决:
修改php.ini,设置phar.readonly = 0
[Phar]
; https://php.net/phar.readonly
;phar.readonly = On
phar.readonly = 0
2,
Downloading PHP8.4 ...
Download php8.4.micro.sfx.zip failed, 404 Not Found
因为8.4发布时间不长,线上还没有相应的zip包,
解决:
指定低一点的版本即可:
$ php webman build:bin 8.3
Route /delete ["app\\controller\\LoginController","delete"] is not callable
Phar packing...
Files collect complete, begin add file to Phar.
Write requests to the Phar archive, save changes to disk.Downloading PHP8.3 ...
[====================================================================================================>100%]Saved webman.bin to /data/webman/gyadmin/gyadmin/build/webman.bin
Build Success!
三,查看打包后文件:
在build目录下可以看到打包后的文件:
$ ls build/
php8.3.micro.sfx php8.3.micro.sfx.zip webman.bin webman.phar
四,运行:
把webman.bin文件上传到服务器后运行即可:
$ ./webman.bin start