workerman可以一直運(yùn)行,以daemon(守護(hù)進(jìn)程)方式啟動(dòng)workerman即可后臺(tái)一直運(yùn)行。
啟動(dòng)停止workerman:
啟動(dòng)
以debug(調(diào)試)方式啟動(dòng)
php?start.php?start
以daemon(守護(hù)進(jìn)程)方式啟動(dòng)
php?start.php?start?-d
停止
php?start.php?stop
重啟
php?start.php?restart
平滑重啟
php?start.php?reload
查看狀態(tài)
php?start.php?status
debug和daemon方式區(qū)別:
1、以debug方式啟動(dòng),代碼中echo、var_dump、print等打印函數(shù)會(huì)直接輸出在終端。
2、以daemon方式啟動(dòng),代碼中echo、var_dump、print等打印會(huì)默認(rèn)重定向到/dev/NULL文件,可以通過(guò)設(shè)置Worker::$stdoutFile = ‘/your/path/file’;來(lái)設(shè)置這個(gè)文件路徑。
3、以debug方式啟動(dòng),終端關(guān)閉后workerman會(huì)隨之關(guān)閉并退出。
4、以daemon方式啟動(dòng),終端關(guān)閉后workerman繼續(xù)后臺(tái)正常運(yùn)行。
推薦:workerman教程
? 版權(quán)聲明
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載。
THE END
喜歡就支持一下吧
相關(guān)推薦