Home > Article > PHP Framework > 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):
2. Result debugging socket code When the process ends and is reopened, it always shows that the port is occupied
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
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
Step 3: Kill this process
The command is as follows:
kill -9 18669
You can re-open the listening program at this time, and there will no longer be an error that the port is occupied
(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!