PHP, in 5.4 and later, comes with a built-in webserver for development purposes. This is very handy, as it allows you to kickstart development quickly, avoiding having to install and configure Apache / Nginx. All you need here is PHP 5.4+ with command line binary.
Symfony comes with a wrapper script for booting the built-in webserver: server:run
. It's a nice shortcut as it will correctly set the web root depending on your configuration, and with eZ Platform it can be used as is.
Use this command for local development purpose only! |
The following example will start the webserver on http://127.0.0.1:8000 on your machine, in Symfony dev environment for debug use:
php app/console server:run |
The following example will start the webserver on http://localhost:8000 on your machine, in Symfony prod environment for demo/testing use:
php app/console server:run --env=prod localhost:8000 |
As with any Symfony command, you may execute the command with a -h
flag to get up-to-date help text for the command:
php app/console server:run -h |
Further reading: