When I run the server using php bin/console server:run I get the following error.
There are no commands defined in the \"server\" namespace.
you must execute this command:
composer req webserver
Verify that the correct APP_ENV is set in the environment. In my case, it was critical.
I had same issue on Symfony 4 after switching in .env to prod. Some commands are not visible on prod.
You either need to swap to dev or:
bin/console --env=dev
And so to start server:
bin/console --env=dev server:run 0.0.0.0:8005
Remove env.local file if you've it.
Reson: Because server:run is not executing on production environment
run this command before starting the server.
composer require symfony/web-server-bundle --dev