yiisoft / yii-console

Yii console components
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
64 stars 31 forks source link

dinamic port #178

Closed pamparam83 closed 1 year ago

pamparam83 commented 1 year ago

add supports dynamic port selection. in command ./yii serve

rustamwin commented 1 year ago

There already PR was rejected https://github.com/yiisoft/yii-console/pull/139

samdark commented 1 year ago

You can specify 0 as port already and it will choose a free port.

pamparam83 commented 1 year ago

Yes, if you specify 0, then something like this will appear in the console

Server started on http://127.0.0.1:0/ Document root is "/home..." Routing file is "public/index.php" Quit the server with CTRL-C or COMMAND-C. [74064] [Fri Apr 14 13:40:56 2023] PHP 8.2.4 Development Server (http://127.0.0.1:4525) started [74063] [Fri Apr 14 13:40:56 2023] PHP 8.2.4 Development Server (http://127.0.0.1:4525) started

which is not entirely clear Server started on http://127.0.0.1:0/ - not work my suggestion eliminates this problem