简体   繁体   English

PHP后台进程

[英]PHP background process

I've wrote a php irc bot, but i need it to work in the background. 我写了一个php irc bot,但我需要它在后台工作。 With this there'd be no quits or so. 有了这个就没有退出。 What is the best way to do this? 做这个的最好方式是什么?

Thanks and Regards. 感谢致敬。

Take a look at the following website. 看看以下网站。 There is a pretty descend explanation on how to write PHP daemons. 关于如何编写PHP守护进程有一个非常下降的解释。

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

Run it in screen , then detach. 屏幕中运行它,然后分离。 You can then quit the terminal and re-attach to the screen session later. 然后,您可以退出终端并稍后重新连接到屏幕会话。

我使用类似的东西:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM