Skip to content

Commit e7179db

Browse files
committed
minor #8273 Reworded the built-in web server articles for Symfony 3.3 (javiereguiluz)
This PR was squashed before being merged into the 3.3 branch (closes #8273). Discussion ---------- Reworded the built-in web server articles for Symfony 3.3 This fixes #8270. The current scenario for Symfony 3.3 is the worst possible: we don't have the web server by default (like in 3.2) ... and it's not easy to install it (like in 3.3+Flex or 4.0). That's why I propose to add a link in the main `setup.rst` article to the full explanation about installing and enabling the bundle. In 4.0, we can remove that link and simply say: run `symfony require web-server` and then, execute `./bin/console server:run`. Commits ------- 0cd417b Reworded the built-in web server articles for Symfony 3.3
2 parents 23e18a0 + 0cd417b commit e7179db

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)