swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 788 forks source link

Tcp startup parameter is not configured #208

Closed zhangxuanru closed 6 years ago

zhangxuanru commented 6 years ago
Q A
Bug report? yes/no
Feature request? yes/no
Swoft version x.y.z
Swoole version x.y.z (by php --ri swoole)
PHP version x.y.z (by php -v)
Runtime environment Win10/Mac/CentOS 7/Ubuntu/Docker etc.

Details 框架必须要启动TCP吗?不想启动TCP端口是在哪设置呢?

Describe what you are trying to achieve and what goes wrong.

// paste output here

这是配置文件: return [ 11 ¦ 'server' => [ 12 ¦ ¦ ¦ 'pfile' => env('PFILE', '/tmp/swoft.pid'), 13 ¦ ¦ ¦ 'pname' => env('PNAME', 'php-swoft'), 14 ¦ ¦ ¦ 'tcpable' => env('TCPABLE', true), 15 ¦ ¦ ¦ 'cronable' => env('CRONABLE', false), 16 ¦ ¦ ¦ 'autoReload' => env('AUTO_RELOAD', true), 17 ¦ ], 18 ¦/ 'tcp' => [ 19 ¦ ¦ ¦ 'host' => env('TCP_HOST', '0.0.0.0'), 20 ¦ ¦ ¦ 'port' => env('TCP_PORT', 8099), 21 ¦ ¦ ¦ 'mode' => env('TCP_MODE', SWOOLE_PROCESS), 22 ¦ ¦ ¦ 'type' => env('TCP_TYPE', SWOOLE_SOCK_TCP), 23 ¦ ¦ ¦ 'package_max_length' => env('TCP_PACKAGE_MAX_LENGTH', 2048), 24 ¦ ¦ ¦ 'open_eof_check' => env('TCP_OPEN_EOF_CHECK', false), 25 ¦ ¦ ],/

我把TCP的配置注释掉了

Provide minimal script to reproduce the issue

// paste code

./bin/swoft start 报错信息如下: Tcp startup parameter is not configured,settings={"server":{"pfile":"\/tmp\/swoft.pid","pname":"php-swoft","tcpable":true,"cronable":false,"autoReload":true},"http":{"host":"0.0.0.0","port":88,"mode":3,"type":1},"crontab":{"task_count":1024,"task_queue":2048},"setting":{"worker_num":1,"max_request":10000,"daemonize":0,"dispatch_mode":2,"log_file":"@runtime\/logs\/swoole.log","task_worker_num":1,"package_max_length":2048,"upload_tmp_dir":"@runtime\/uploadfiles","document_root":"\/home\/www\/test\/swoft\/swoft\/public","enable_static_handler":true,"open_http2_protocol":false,"ssl_cert_file":"","ssl_key_file":"","task_ipc_mode":2,"message_queue_key":1879052289,"task_tmpdir":"\/tmp"}}

inhere commented 6 years ago

.env 配置这个禁用:

TCPABLE = false