PHP background process

半城伤御伤魂 提交于 2019-12-07 02:05:41

问题


I've wrote a php irc bot, but i need it to work in the background. With this there'd be no quits or so. What is the best way to do this?

Thanks and Regards.


回答1:


Take a look at the following website. There is a pretty descend explanation on how to write PHP daemons.

http://kevin.vanzonneveld.net/techblog/article/create_daemons_in_php/




回答2:


Run it in screen, then detach. You can then quit the terminal and re-attach to the screen session later.




回答3:


I use something similar:

nohup php /path/to/script.php > /dev/null 2> /dev/null&


来源:https://stackoverflow.com/questions/3515615/php-background-process

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!