三种解决办法:
- nohup
[root@iZj6cfzkpp77ljw6grkiypZ notify2.aowhy.com]# nohup php serve.php &
2。setsid
[root@iZj6cfzkpp77ljw6grkiypZ notify2.aowhy.com]#setsid ping www.pythontab.com
[root@iZj6cfzkpp77ljw6grkiypZ notify2.aowhy.com]# ps -ef |grep www.pythontab.com
3。& subshell
[root@iZj6cfzkpp77ljw6grkiypZ notify2.aowhy.com]# (php serve.php &)
[root@iZj6cfzkpp77ljw6grkiypZ notify2.aowhy.com]# ps -ef|grep serve.php
root 10318 9153 0 10:19 pts/1 00:00:00 php serve.php
root 10319 10318 0 10:19 pts/1 00:00:00 php serve.php
root 10321 10319 0 10:19 pts/1 00:00:00 php serve.php
root 10324 9153 0 10:19 pts/1 00:00:00 grep --color=auto serve.php
[root@pythontab ~]#