symfony/symfony — pull request #3465 by michal-pipa (2012-02-27 22:22:58+00:00)
Title: [FrameworkBundle] Added server:run command (PHP 5.4 built-in web server)

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/michal-pipa/symfony.png?branch=server)](http://travis-ci.org/michal-pipa/symfony)
Fixes the following tickets: -
Todo: -

PHP 5.4 comes with [built-in web server](http://www.php.net/manual/en/features.commandline.webserver.php). I've created command which allows to easily run Symfony2 application using this new feature.

Usage:
server:run [-d|--docroot="..."] [-r|--router="..."] [address]

Arguments:
address Address:port (default: 'localhost:8000')

Options:
--docroot (-d) Document root (default: 'web/')
--router (-r) Path to custom router script

Help:
The server:run runs Symfony2 application using PHP built-in web server:

app/console server:run

To change default bind address and port use the address argument:

app/console server:run 127.0.0.1:8080

To change default docroot directory use the --docroot option:

app/console server:run --docroot=htdocs/

If you have custom docroot directory layout, you can specify your own
router script using --router option:

app/console server:run --router=app/config/router.php

See also: http://www.php.net/manual/en/features.commandline.webserver.php

It requires PHP 5.4, otherwise this command will be disabled.

I think that this is very convenient (especially for new users). All you have to do is download Symfony, install vendors and run this command. You don't have to configure "real" web server, in fact any other server is not required. You don't have cache and logs permission problem, because server runs with your local user permissions.