8000 Reworded the built-in web server articles for Symfony 3.3 · symfony/symfony-docs@0cd417b · GitHub
[go: up one dir, main page]

Skip to content

Commit 0cd417b

Browse files
javiereguiluzxabbuh
authored andcommitted
Reworded the built-in web server articles for Symfony 3.3
1 parent 2d83789 commit 0cd417b

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed

setup.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,20 @@ the ``create-project`` command:
158158
Running the Symfony Application
159159
-------------------------------
160160

161-
Symfony leverages the internal PHP web server (available since PHP 5.4) to run
162-
applications while developing them. Therefore, running a Symfony application is
163-
a matter of browsing to the project directory and executing this command:
161+
In production servers, Symfony applications use web servers such as Apache or
162+
Nginx (see :doc:`configuring a web server to run Symfony </setup/web_server_configuration>`).
163+
However, in your local development machine you can also use the web server
164+
provided by Symfony, which in turn uses the built-in web server provided by PHP.
165+
166+
First, :doc:`install the Symfony Web Server </setup/built_in_web_server>` and
167+
then, execute this command:
164168

165169
.. code-block:: terminal
166170
167171
$ cd my_project_name/
168172
$ php bin/console server:run
169173
170-
Then, open your browser and access the ``http://localhost:8000/`` URL to see the
174+
Open your browser and access the ``http://localhost:8000/`` URL to see the
171175
Welcome Page of Symfony:
172176

173177
.. image:: /_images/quick_tour/welcome.png
@@ -184,7 +188,7 @@ pressing ``Ctrl+C`` from the terminal or command console.
184188

185189
.. tip::
186190

187-
PHP's internal web server is great for developing, but should **not** be
191+
Symfony's web server is great for developing, but should **not** be
188192
used on production. Instead, use Apache or Nginx.
189193
See :doc:`/setup/web_server_configuration`.
190194

setup/built_in_web_server.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,42 @@ a full-featured web server such as
1515
The built-in web server is meant to be run in a controlled environment.
1616
It is not designed to be used on public networks.
1717

18+
Symfony provides a web server built on top of this PHP server to simplify your
19+
local setup. This server is distributed as a bundle, so you must first install
20+
and enable the server bundle.
21+
22+
Installing the Web Server Bundle
23+
--------------------------------
24+
25+
First, execute this command:
26+
27+
.. code-block:: terminal
28+
29+
$ cd your-project/
30+
$ composer require symfony/web-server-bundle
31+
32+
Then, enable the bundle in the kernel of the application::
33+
34+
// app/AppKernel.php
35+
class AppKernel extends Kernel
36+
{
37+
public function registerBundles()
38+
{
39+
$bundles = array(
40+
// ...
41+
42+
if ('dev' === $this->getEnvironment()) {
43+
// ...
44+
$bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
45+
}
46+
);
47+
48+
// ...
49+
}
50+
51+
// ...
52+
}
53+
1854
Starting the Web Server
1955
-----------------------
2056

0 commit comments

Comments
 (0)
0