diff --git a/src/think/console/command/RunServer.php b/src/think/console/command/RunServer.php index 92bdd3d49e..b117c15f7f 100644 --- a/src/think/console/command/RunServer.php +++ b/src/think/console/command/RunServer.php @@ -48,8 +48,8 @@ public function configure() public function execute(Input $input, Output $output) { - $host = $input->getOption('host'); - $port = $input->getOption('port'); + $host = $input->getOption('host') ?: env('server.host', '0.0.0.0'); + $port = $input->getOption('port') ?: env('server.port', 8000); $root = $input->getOption('root'); if (empty($root)) { $root = $this->app->getRootPath() . 'public';