Http service command

Execute the following command in the project root directory

 $ php bin/swoft http
Provide some commands to manage the swoft HTTP Server

Group: http (alias: httpserver,httpServer,http-server)
Usage:
  bin/swoft http:COMMAND [--opt ...] [arg ...]

Global Options:
      --debug      Setting the application runtime debug level(0 - 4)
      --no-color   Disable color/ANSI for message output
  -h, --help       Display this help message
  -V, --version    Show application version information

Commands:
  reload    Reload worker processes
  restart   Restart the http server
  start     Start the http server
  stop      Stop the currently running server

Example:
 bin/swoft http:start     Start the http server
 bin/swoft http:stop      Stop the http server

View the specified command, please use: bin/swoft http:COMMAND -h
 

Http commands are in Commands

  • Reload reload the worker process
  • Restart Restart the Http server
  • Start start Http server
  • Stop stop Http server

use

  • Front desk operation
 $ php bin/swoft http:start
                            Information Panel
  ***********************************************************************
  * HTTP     | Listen: 0.0.0.0:18306, type: TCP, mode: Process, worker: 1
  * rpc      | Listen: 0.0.0.0:18307, type: TCP
  ***********************************************************************

HTTP server start success ! 
  • Background process
 $ php bin/swoft http:start -d
                            Information Panel
  ***********************************************************************
  * HTTP     | Listen: 0.0.0.0:18306, type: TCP, mode: Process, worker: 1
  * rpc      | Listen: 0.0.0.0:18307, type: TCP
  ***********************************************************************

HTTP server start success ! 

Access the Http service in the browser through http://127.0.0.1:18306/

/docs/2.x/en/http-server/command.html
progress-bar