Home  >  Article  >  PHP Framework  >  How to shut down the daemon process with swoole

How to shut down the daemon process with swoole

藏色散人
藏色散人Original
2020-04-10 09:52:323523browse

How to shut down the daemon process with swoole

swooleHow to close? How to shut down the daemon process if swoole accidentally started it?

1. I used swoole in the project today and accidentally enabled the daemon process in the configuration (that is, the process always runs in the background)

How to shut down the daemon process with swoole

2. As a result, when debugging the socket code, the process was ended and reopened, and it always showed that the port was occupied

How to shut down the daemon process with swoole

3. At this time, even if the terminal command running window was closed, reopen it. , the port is also occupied and the process cannot be started again. The solution is as follows:

The first step is to change the daemon process in the code to 0

How to shut down the daemon process with swoole

The second step is to find the pid of this port number (I The port the code listens to is 9503), and the PID

command is as follows:

netstat -apn | grep 9503

How to shut down the daemon process with swoole

Step 3: Kill the process

The command is as follows:

kill -9 18669

Now you can re-enable the listening program, and no more errors will be reported that the port is occupied

How to shut down the daemon process with swoole

The above is the detailed content of How to shut down the daemon process with swoole. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn