I want to start a server with symfony server:start using the port that is set in my .env file. Is there a way to do this?
I want to start a server with symfony server:start using the port that is set in my .env file. Is there a way to do this?
For anyone stumbling here from google like I did, use the flag --port=PORTNUMBER
Example:
symfony server:start --port=8080
OR
php bin/console server:start --port=8080
The help page documentation states this like so:
--port=value Preferred HTTP port [default: 8000]
php bin/console server:start --help
Gives the info you want
Usage:
server:start [options] [--] [<addressport>]
Arguments:
addressport The address to listen to (can be address:port, address, or port)
So type
Change the default address and port by passing them as an argument:
php bin/console server:start 127.0.0.1:8080