Skip to content

[WebserverBundle] Deprecate the bundle in favor of symfony local server #31217

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

Conversation

Simperfit
Copy link
Contributor

@Simperfit Simperfit commented Apr 23, 2019

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets none
License MIT
Doc PR to do

Since most of the feature added to the symfony local server (using php-fpm) will be handy for all developers and as said in #25748 (comment), I agree that we should deprecate the WebserverBundle in favor of the Symfony Local Server cc @stof @fabpot

@nicolas-grekas
Copy link
Member

That's for 4.4 I believe, and we should display nice runtime deprecation notices also.
In 5.0, I'd keep the commands as hidden aliases to display a friendly notice too, in FWB this time.

@Simperfit Simperfit force-pushed the deprecation/deprecate-the-webserver-bundle-in-favor-of-symfony-local-server branch from addc686 to d30036d Compare April 26, 2019 06:46
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Apr 26, 2019

If we go that way, we should maybe add a special case in flex to ease installing the binary?
That would also need a recipe update, see
https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/4.2/post-install.txt

See symfony/flex#491

@Simperfit Simperfit force-pushed the deprecation/deprecate-the-webserver-bundle-in-favor-of-symfony-local-server branch from d30036d to f6c97a6 Compare April 29, 2019 16:41
@Simperfit Simperfit force-pushed the deprecation/deprecate-the-webserver-bundle-in-favor-of-symfony-local-server branch from f6c97a6 to 396cc5e Compare May 18, 2019 05:51
@zorn-v
Copy link

zorn-v commented Jun 4, 2019

I think it is bad idea.
I dont need any soft other than php on my dev environment. Otherwise I'll just install nginx/apache/etc.

@Simperfit Simperfit force-pushed the deprecation/deprecate-the-webserver-bundle-in-favor-of-symfony-local-server branch from 396cc5e to 7307907 Compare July 8, 2019 09:41
@Simperfit Simperfit changed the base branch from master to 4.4 July 8, 2019 09:41
@Simperfit
Copy link
Contributor Author

Status: Needs review

@fabpot
Copy link
Member

fabpot commented Jul 8, 2019

@zorn-v The deprecation message mention that you can use the Symfony local web server. But you can use whatever you want indeed. I like the removal of web server bundle as the PHP built-in web server lacks too many needed features (concurrency, TLS support, HTTP/2, ...).

@fabpot
Copy link
Member

fabpot commented Jul 8, 2019

Thank you @Simperfit.

fabpot added a commit that referenced this pull request Jul 8, 2019
…fony local server (Simperfit)

This PR was merged into the 4.4 branch.

Discussion
----------

[WebserverBundle] Deprecate the bundle in favor of symfony local server

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | to do <!-- required for new features -->

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against the master branch.
-->

Since most of the feature added to the symfony local server (using php-fpm) will be handy for all developers and as said in #25748 (comment), I agree that we should deprecate the WebserverBundle in favor of the [Symfony Local Server](https://symfony.com/doc/current/setup/symfony_server.html) cc @stof @fabpot

Commits
-------

7307907 [WebserverBundle] Deprecate the bundle in favor of symfony local server
@lyrixx
Copy link
Member

lyrixx commented Jul 8, 2019

I would not deprecates server:log. The one in symfony is much more powerful (filtering for instance) and does not work like symfony binary works. Instead of parsing logs, it listen on a port, and is able to differentiate client (color prefix). More over the output is more beautiful 😬

@emodric
Copy link
Contributor

emodric commented Jul 12, 2019

There is one fairly important feature that lacks from the Symfony local web server. The ability to specify an IP address of the server. This is mainy useful when you want to bind the server to all network interfaces with 0.0.0.0.

@zorn-v
Copy link

zorn-v commented Jul 12, 2019

@fabpot

PHP built-in web server lacks too many needed features (concurrency, TLS support, HTTP/2, ...).

Needed very rarely for local development...

Maybe hint in deprecation note like If you want old behavior just run "php -S localhost:8000 -t public" (or maybe php -S localhost:8000 public/index.php) ?

BTW, I found out about "-S" option thanking symfony server start/run command ) just was wondering.

@Simperfit Simperfit deleted the deprecation/deprecate-the-webserver-bundle-in-favor-of-symfony-local-server branch July 14, 2019 14:35
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
This was referenced Nov 12, 2019
@kojidev
Copy link

kojidev commented Dec 10, 2019

WHY? God why? Who needs tls on local machine? Install nginx ffs, might aswell rename it to symfony global server, because that's what it is, it is system wide binary that I have to install beforehand.

@stof
Copy link
Member

stof commented Dec 10, 2019

Reasons you might need these features:

  • concurrency: as soon as your make AJAX requests or open 2 tabs, to have something similar to the prod (disabling concurrency in the server is a good way to remove all possible race conditions, but will you actually do that in prod ?)
  • TLS: as soon as you need to use any modern browser feature that is available only in secure context. And also when you want to use OAuth, as your redirect URL must also be HTTPS by the spec
  • HTTP/2: well, if you want to develop using HTTP/2 feature (server push for instance), you'd better be able to test it before reaching the prod.

You can indeed also install nginx locally (and then configure TLS locally if you want that part). That's not forbidden by this PR. This PR is about deprecating WebServerBundle, which is a wrapper around php -S and so suffers from all its limitations.

@guilliamxavier
Copy link
Contributor

@lyrixx

There is one fairly important feature that lacks from the Symfony local web server. The ability to specify an IP address of the server. This is mainy useful when you want to bind the server to all network interfaces with 0.0.0.0.

Indeed, I am using a docker-compose network of services (containers) with
command: ["php", "bin/console", "server:run", "0.0.0.0:8000"]
and it won't be possible anymore in Symfony 5.0 🙁

https://github.com/symfony/cli/issues/107 was closed as

This is not supported as of now but we save the idea and will think about it for a future version.

https://github.com/symfony/cli/issues/128 is still open (no answer from team yet)

(and https://github.com/symfony/cli/issues/183 is kinda related too)

@zorn-v
Copy link

zorn-v commented Jan 8, 2020

Use command: ["php", "-S", "0.0.0.0:8000", "-t", "public", "public/index.php"]
But it is very bad for production. Only one request can handle in one time.

PS. server:run runs php -S by the way.

@guilliamxavier
Copy link
Contributor

guilliamxavier commented Jan 8, 2020

@zorn-v Thanks, I tested that already, but that is not strictly equivalent (the WebServerBundle adds more options and a custom router.php file)

Edit: Of course not for production, only for development on local machine

@zorn-v
Copy link

zorn-v commented Jan 8, 2020

https://github.com/symfony/symfony/blob/v4.4.2/src/Symfony/Bundle/WebServerBundle/Resources/router.php

Nothing special

PS. app_dev in comments... from older symfony

@drzraf
Copy link

drzraf commented May 18, 2020

The actual reason to clutter developers' logs with this deprecation warning is to push them to use the closed-source "alternative" (https://github.com/symfony/cli/issues/37)

WebServerBundle is by no way deprecated technically. Economically maybe?
There has been no visible debate/ticket/announcement about why this would happen.

Nothing stops anyone from producing closed-source by-products or sell commercial services.
But a too aggressive promotion of a closed-source solution can only harm the overall software ecosystem.

Taking advantage of a large user-base trusting this software (and its open-source quality) to push a closed-source tool as the only development alternative is a really bad move I suggest you reconsider (the fact that this, mostly confidential, PR is already the 4th most down-voted one should be hint... until comments get closed here too)

As one of the thousands of developers who won't install an opaque binary for their development, I strongly hope that maintenance PR for the webserver-bundle will not be discarded.

  • The first step would be to create a dedicated repository (like for other bundles)
  • Revert this very PR that attempt to drop a working solution for no technical reason.
  • Push a 5.x tag

By chance this deprecation does not affect production servers. But from now on... who knows what could come next?

NB: Just found https://www.reddit.com/r/PHP/comments/foqs7x/symfony_docs_make_it_look_like_you_have_to_use/ :

It at least feels like they artificially broke compatibility, by not bumping it to version 5.0, to promote the closed source binary.

@nicolas-grekas
Copy link
Member

nicolas-grekas commented May 19, 2020

This answer in the reddit thread you linked perfectly explains the rationale and the alternative that is in your hands. Now locking since shaming won't help anything nor anyone.

Screenshot_20200519-062913_Firefox

@symfony symfony locked as resolved and limited conversation to collaborators May 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.