Skip to content

Replace the PHP built-in server with the Symfony CLI one #11567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
replaced PHP built-in server with the Symfony CLI one
  • Loading branch information
fabpot committed May 13, 2019
commit 473e07285d64208a95fdf0bd85b582e9ba70905c
10 changes: 6 additions & 4 deletions configuration/micro_kernel_trait.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ Next, create an ``index.php`` file that creates a kernel class and executes it::
$response->send();
$kernel->terminate($request, $response);

That's it! To test it, you can start the built-in web server:
That's it! To test it, start the :doc:`Symfony Local Web Server
</setup/symfony_server>`:

.. code-block:: terminal

$ php -S localhost:8000
$ symfony server:start

Then see the JSON response in your browser:

Expand Down Expand Up @@ -335,12 +336,13 @@ this:
├─ composer.json
└─ composer.lock

As before you can use PHP built-in server:
As before you can use the :doc:`Symfony Local Web Server
</setup/symfony_server>`:

.. code-block:: terminal

cd web/
$ php -S localhost:8000
$ symfony server:start

Then see webpage in browser:

Expand Down
6 changes: 3 additions & 3 deletions create_framework/front_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ web root directory:
Now, configure your web server root directory to point to ``web/`` and all
other files won't be accessible from the client anymore.

To test your changes in a browser (``http://localhost:4321/hello?name=Fabien``), run
the PHP built-in server:
To test your changes in a browser (``http://localhost:4321/hello?name=Fabien``),
run the :doc:`Symfony Local Web Server </setup/symfony_server>`:

.. code-block:: terminal

$ php -S 127.0.0.1:4321 -t web/ web/front.php
$ symfony server:start --port=4321 --passthru=front.php

.. note::

Expand Down
9 changes: 4 additions & 5 deletions create_framework/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,13 @@ start with the simplest web application we can think of in PHP::

printf('Hello %s', $name);

You can use the PHP built-in server to test this great application in a browser
(``http://localhost:4321/index.php?name=Fabien``):
You can use the :doc:`Symfony Local Web Server </setup/symfony_server>` to test
this great application in a browser
(``http://localhost:8000/index.php?name=Fabien``):

.. code-block:: terminal

$ php -S 127.0.0.1:4321

Otherwise, you can always use your own server (Apache, Nginx, etc.).
$ symfony server:start

In the :doc:`next chapter </create_framework/http_foundation>`, we are going to
introduce the HttpFoundation Component and see what it brings us.
Expand Down