- ubnutu
- php 7.16
- swoole
# 日志文件
mkdir logs
chown www:www logs
# 配置文件
vim src/config.php
<?php
$config = [
'dict' => './dict/dict.txt',
'blackword' => './dict/blackword.tree',
'port' => 9002,
'ip' => '0.0.0.0'
];
php reloadDictTrieTree.php # 加载数据字典对象
# 启动方法1:启动swoole服务
php httpServerTrieTree.php
# 启动方法2:挂载swoole服务
nohup php ./httpServerTrieTree.php &>> ./logs/nohup.log &
访问 http://xxx.xxx.xxx.xxx:9002/?content=今晚约炮哦,sm
{
"data": {
"8e338ee8919dff35298f5d75485a78d4": {
"word": "xx",
"data": [],
"count": 1
},
"ed79acb0cd3d7f8320c53c7798335ef0": {
"word": "xx",
"data": [],
"count": 1
}
},
"time": "0.000061",
"memory": "1200.0737609863M"
}