diff --git a/setup.rst b/setup.rst index 51c20a9a0c8..d43d93df55a 100644 --- a/setup.rst +++ b/setup.rst @@ -158,16 +158,20 @@ the ``create-project`` command: Running the Symfony Application ------------------------------- -Symfony leverages the internal PHP web server (available since PHP 5.4) to run -applications while developing them. Therefore, running a Symfony application is -a matter of browsing to the project directory and executing this command: +In production servers, Symfony applications use web servers such as Apache or +Nginx (see :doc:`configuring a web server to run Symfony `). +However, in your local development machine you can also use the web server +provided by Symfony, which in turn uses the built-in web server provided by PHP. + +First, :doc:`install the Symfony Web Server ` and +then, execute this command: .. code-block:: terminal $ cd my_project_name/ $ php bin/console server:run -Then, open your browser and access the ``http://localhost:8000/`` URL to see the +Open your browser and access the ``http://localhost:8000/`` URL to see the Welcome Page of Symfony: .. image:: /_images/quick_tour/welcome.png @@ -184,7 +188,7 @@ pressing ``Ctrl+C`` from the terminal or command console. .. tip:: - PHP's internal web server is great for developing, but should **not** be + Symfony's web server is great for developing, but should **not** be used on production. Instead, use Apache or Nginx. See :doc:`/setup/web_server_configuration`. diff --git a/setup/built_in_web_server.rst b/setup/built_in_web_server.rst index d8d74dac183..edcb58b0768 100644 --- a/setup/built_in_web_server.rst +++ b/setup/built_in_web_server.rst @@ -15,6 +15,42 @@ a full-featured web server such as The built-in web server is meant to be run in a controlled environment. It is not designed to be used on public networks. +Symfony provides a web server built on top of this PHP server to simplify your +local setup. This server is distributed as a bundle, so you must first install +and enable the server bundle. + +Installing the Web Server Bundle +-------------------------------- + +First, execute this command: + +.. code-block:: terminal + + $ cd your-project/ + $ composer require symfony/web-server-bundle + +Then, enable the bundle in the kernel of the application:: + + // app/AppKernel.php + class AppKernel extends Kernel + { + public function registerBundles() + { + $bundles = array( + // ... + + if ('dev' === $this->getEnvironment()) { + // ... + $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle(); + } + ); + + // ... + } + + // ... + } + Starting the Web Server -----------------------