Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php think swoole 无法动态指定端口号 #373

Open
seebyyu opened this issue Aug 23, 2024 · 0 comments
Open

php think swoole 无法动态指定端口号 #373

seebyyu opened this issue Aug 23, 2024 · 0 comments

Comments

@seebyyu
Copy link

seebyyu commented Aug 23, 2024

场景

同一套代码,可以跑不同的配置
理想情况是 修改 config/swoole.php 的 http.port 写到 env 里面

'http'       => [
    'enable'     => true,
    'host'       => '0.0.0.0',
    'port'       => env('SWOOLE_PORT', 8080),
    'worker_num' => swoole_cpu_num(),
    'options'    => [],
],

然后使用命令,可以加载不同配置

php think swoole --env

实际效果是端口依旧使用的是 默认 .env 指定的端口 而且 php think swoole 的入参也不支持自定义端口号。
类似这样

php think swoole --env dev --port 8081
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant