7

When I enter this command in Visual Studio Code terminal to install the server package in my project (composer require server --dev) it shows this error message

[InvalidArgumentException]
Could not find package symfony/web-server-bundle in a version matching 5.0.* "

Jawhar Chebbi
  • 91
  • 1
  • 1
  • 3
  • 4
    The simple though somewhat sad reason is that the web server bundle will not be supported for S5 and beyond. Use the symfony executable instead. https://symfony.com/doc/current/setup/symfony_server.html – Cerad Nov 21 '19 at 21:38

4 Answers4

20

You need to add the version to. Like this:

composer require symfony/web-server-bundle --dev ^4.4.2

You can check for the latest version here: https://packagist.org/packages/symfony/web-server-bundle

Cristian
  • 348
  • 2
  • 14
  • Why is that needed? If I don't specify the version, does it not mean that I prefer the most up-to-date one? – noam Oct 31 '20 at 18:23
  • The last version available is very possible to not be compatible whit your current requirement. If you let the composer to provide you the last version is very possible for your app to break.. – Cristian Nov 02 '20 at 09:40
  • Okay that could be. I had the same error message as OP's, but it was solved after I added the latest version number. – noam Nov 02 '20 at 15:18
4

Install Symfony https://symfony.com/download and use :

  • symfony server:start
  • or symfony server:start -d
Alexandre Tranchant
  • 4,426
  • 4
  • 43
  • 70
montassar
  • 49
  • 1
0

The development web-server is included in the symfony client.

Install the symfony cli : https://symfony.com/download

Then, you can start the dev web server

symfony server:start
7seb
  • 172
  • 10
-1

If you are in development, you can simply use the inbuilt PHP server.

Change directory to your Symfony project directory and run the following

php -S localhost:8001 -t public

Emeka Mbah
  • 16,745
  • 10
  • 77
  • 96