【发布时间】:2019-10-23 11:36:33
【问题描述】:
我想使用在我的 .env 文件中设置的端口以symfony server:start 启动服务器。有没有办法做到这一点?
【问题讨论】:
我想使用在我的 .env 文件中设置的端口以symfony server:start 启动服务器。有没有办法做到这一点?
【问题讨论】:
对于像我一样从谷歌跌跌撞撞的人,请使用标志--port=PORTNUMBER
例子:
symfony server:start --port=8080
或
php bin/console server:start --port=8080
帮助页面文档是这样描述的:
--port=value 首选 HTTP 端口 [默认:8000]
【讨论】:
php bin/console server:start --help
提供你想要的信息
Usage:
server:start [options] [--] [<addressport>]
Arguments:
addressport The address to listen to (can be address:port, address, or port)
所以输入
Change the default address and port by passing them as an argument:
php bin/console server:start 127.0.0.1:8080
【讨论】: