@@ -58,7 +58,7 @@ to test this code properly.
58
58
59
59
Moreover, adding a new page means that we need to create a new PHP script,
60
60
which name is exposed to the end user via the URL
61
- (``http://127.0.0.1:4321 /bye.php ``): there is a direct mapping between the PHP
61
+ (``http://127.0.0.1:8000 /bye.php ``): there is a direct mapping between the PHP
62
62
script name and the client URL. This is because the dispatching of the request
63
63
is done by the web server directly. It might be a good idea to move this
64
64
dispatching to our code for better flexibility. This can be achieved by routing
@@ -109,17 +109,17 @@ we return a custom 404 page; you are now in control of your website.
109
109
110
110
To access a page, you must now use the ``front.php `` script:
111
111
112
- * ``http://127.0.0.1:4321 /front.php/hello?name=Fabien ``
112
+ * ``http://127.0.0.1:8000 /front.php/hello?name=Fabien ``
113
113
114
- * ``http://127.0.0.1:4321 /front.php/bye ``
114
+ * ``http://127.0.0.1:8000 /front.php/bye ``
115
115
116
116
``/hello `` and ``/bye `` are the page *paths *.
117
117
118
118
.. tip ::
119
119
120
120
Most web servers like Apache or nginx are able to rewrite the incoming URLs
121
121
and remove the front controller script so that your users will be able to
122
- type ``http://127.0.0.1:4321 /hello?name=Fabien ``, which looks much better.
122
+ type ``http://127.0.0.1:8000 /hello?name=Fabien ``, which looks much better.
123
123
124
124
The trick is the usage of the ``Request::getPathInfo() `` method which returns
125
125
the path of the Request by removing the front controller script name including
@@ -153,12 +153,12 @@ web root directory:
153
153
Now, configure your web server root directory to point to ``web/ `` and all
154
154
other files won't be accessible from the client anymore.
155
155
156
- To test your changes in a browser (``http://localhost:4321 /hello?name=Fabien ``), run
157
- the PHP built-in server :
156
+ To test your changes in a browser (``http://localhost:8000 /hello?name=Fabien ``),
157
+ run the :doc: ` Symfony Local Web Server < /setup/symfony_server >` :
158
158
159
159
.. code-block :: terminal
160
160
161
- $ php -S 127.0.0.1:4321 -t web/ web/ front.php
161
+ $ symfony server:start --passthru= front.php
162
162
163
163
.. note ::
164
164
0 commit comments