Is there a forever.js equivalent for PHP to run my scripts continuously?

本秂侑毒 提交于 2019-12-03 10:36:51

Just use forever with your php script (use the -c argument to instruct forever to use php):

$ cat test.php
<?php
sleep(3);
print("foobar\n");
exit;
?>
$ forever -c php test.php
foobar
error: Forever detected script was killed by signal: null
error: Forever restarting script for 1 time
foobar
error: Forever detected script was killed by signal: null
error: Forever restarting script for 2 time
...

I've just discovered this tool supervisord and it works great. I've used this ratchet tutorial to make it run in minutes !

If I remember correctly forever script do not restart when you reboot server ?

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