runserver¶
Runs PHP's built-in http server for development.
- Don't use this for production, it is neither scalable nor secure for this use.
- If you run multiple servers simultaneously, you will need to assign each a unique port.
- Use Ctrl-C or equivalent to stop the server when complete.
Examples¶
drush rs 8080
. Start a web server on 127.0.0.1, port 8080.drush rs 10.0.0.28:80
. Start runserver on 10.0.0.28, port 80.drush rs [::1]:80
. Start runserver on IPv6 localhost ::1, port 80.drush rs --dns localhost:8888/user
. Start runserver on localhost (using rDNS to determine binding IP), port 8888, and open /user in browser.drush rs /
. Start runserver on default IP/port (127.0.0.1, port 8888), and open / in browser.drush rs :9000/admin
. Start runserver on 127.0.0.1, port 9000, and open /admin in browser. Note that you need a colon when you specify port and path, but no IP.drush --quiet rs
. Silence logging the printing of web requests to the console.
Arguments¶
- [uri]. IP address and port number to bind to and path to open in web browser. Format is addr:port/path. Only opens a browser if a path is specified.
Options¶
- --default-server=DEFAULT-SERVER. A default addr:port/path to use for any values not specified as an argument.
- --browser[=BROWSER]. Open the URL in the default browser. Use --no-browser to avoid opening a browser. [default: 1]
- --dns. Resolve hostnames/IPs using DNS/rDNS (if possible) to determine binding IPs and/or human friendly hostnames for URLs and browser.
- --no-browser. Negate --browser option.
Global Options¶
- -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
Aliases¶
- rs
- serve
Legend
- An argument or option with square brackets is optional.
- Any default value is listed at end of arg/option description.
- An ellipsis indicates that an argument accepts multiple values separated by a space.