Home > Article > PHP Framework > 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)
2. As a result, when debugging the socket code, the process was ended and reopened, and it always showed that the port was occupied
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
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
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
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!