Home > PHP Framework > Swoole > body text

How to turn off the daemon process after swoole is enabled?

Release: 2019-12-09 10:15:19
Original
2784 people have browsed it

How to turn off the daemon process after swoole is enabled?

1. Enable the daemon process in the configuration (that is, the process always runs in the background):

How to turn off the daemon process after swoole is enabled?

2. Result debugging socket code When the process ends and is reopened, it always shows that the port is occupied

How to turn off the daemon process after swoole is enabled?

3. Even if the terminal command running window is closed and reopened at this time, the port is still occupied. , 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 turn off the daemon process after swoole is enabled?

The second step : Find the pid of this port number (the port my code listens to is 9503), and the command to get the PID

is as follows:

netstat -apn | grep 9503
Copy after login

How to turn off the daemon process after swoole is enabled?

Step 3: Kill this process

The command is as follows:

kill -9 18669
Copy after login

You can re-open the listening program at this time, and there will no longer be an error that the port is occupied

How to turn off the daemon process after swoole is enabled?

(Recommended learning: swoole video tutorial)

The above is the detailed content of How to turn off the daemon process after swoole is enabled?. 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