Home > Article > PHP Framework > How to keep swoole on
#swoole can be always enabled by starting the daemon process.
A daemon is a long-term survival process that is not controlled by the terminal and can run in the background.
Swoole officially also provides us with the configuration option daemonize. The daemon process is not enabled by default. If you want to enable the daemon process, just set daemonize to true.
Daemonization. When daemonize => 1 is set, the program will go to the background and run as a daemon process. This must be enabled for long-running server-side programs.
If the daemon process is not enabled, the program will be terminated when the ssh terminal exits.
The daemon process has advantages and disadvantages. After we enable the daemon process, all standard output in the server will be discarded. In this way, we will not be able to track error messages such as whether the process is abnormal during operation.
For convenience, swoole provides us with another configuration option log_file. We can specify the log path, so that swoole will record all standard output into the file when running.
Recommended learning: swoole video tutorial
The above is the detailed content of How to keep swoole on. For more information, please follow other related articles on the PHP Chinese website!