Home > PHP Framework > Swoole > body text

How to shut down the daemon process with swoole

藏色散人
Release: 2020-04-10 09:52:32
Original
3485 people have browsed it

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
Copy after login

How to shut down the daemon process with swoole

Step 3: Kill the process

The command is as follows:

kill -9 18669
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!