server:run Exception There are no commands defined in the “server” namespace

前端 未结 13 1391
甜味超标
甜味超标 2020-12-25 10:17

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.

<
相关标签:
13条回答
  • 2020-12-25 10:48

    you must execute this command:

    composer req webserver
    
    0 讨论(0)
  • 2020-12-25 10:48

    Verify that the correct APP_ENV is set in the environment. In my case, it was critical.

    0 讨论(0)
  • 2020-12-25 10:49

    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

    0 讨论(0)
  • 2020-12-25 10:52
    1. Disabling firewall help
    2. running......composer clear cache helped in allowing permission
    3. running......composer req webserver helped clear my commands defined in the "server" namespace
    0 讨论(0)
  • 2020-12-25 10:52

    Remove env.local file if you've it.

    Reson: Because server:run is not executing on production environment

    0 讨论(0)
  • 2020-12-25 10:55

    run this command before starting the server.

    composer require symfony/web-server-bundle --dev
    
    0 讨论(0)
提交回复
热议问题