• Http服务命令
    • 使用

    Http服务命令

    在项目根目录执行如下命令

    1. $ php bin/swoft http
    2. Provide some commands to manage the swoft HTTP Server
    3. Group: http (alias: httpserver,httpServer,http-server)
    4. Usage:
    5. bin/swoft http:COMMAND [--opt ...] [arg ...]
    6. Global Options:
    7. --debug Setting the application runtime debug level(0 - 4)
    8. --no-color Disable color/ANSI for message output
    9. -h, --help Display this help message
    10. -V, --version Show application version information
    11. Commands:
    12. reload Reload worker processes
    13. restart Restart the http server
    14. start Start the http server
    15. stop Stop the currently running server
    16. Example:
    17. bin/swoft http:start Start the http server
    18. bin/swoft http:stop Stop the http server
    19. View the specified command, please use: bin/swoft http:COMMAND -h

    Http的命令都在 Commands

    • reload 重新加载 worker 进程
    • restart 重启 Http 服务器
    • start 启动 Http 服务器
    • stop 停止 Http 服务器

    使用

    • 前台运行
    1. $ php bin/swoft http:start
    2. Information Panel
    3. ***********************************************************************
    4. * HTTP | Listen: 0.0.0.0:18306, type: TCP, mode: Process, worker: 1
    5. * rpc | Listen: 0.0.0.0:18307, type: TCP
    6. ***********************************************************************
    7. HTTP server start success !
    • 后台运行
    1. $ php bin/swoft http:start -d
    2. Information Panel
    3. ***********************************************************************
    4. * HTTP | Listen: 0.0.0.0:18306, type: TCP, mode: Process, worker: 1
    5. * rpc | Listen: 0.0.0.0:18307, type: TCP
    6. ***********************************************************************
    7. HTTP server start success !

    在浏览器通过 http://127.0.0.1:18306/ 访问Http服务