退出时自动重新启动PHP脚本 [英] Automatically Restart PHP Script on Exit

查看:101
本文介绍了退出时自动重新启动PHP脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以使PHP脚本在退出时自动重启,而不管它是否已正确退出,由于错误而终止,或内存使用率最大化等?

Is there a way I can automatically restart a PHP script whenever it exits, regardless of whether it has been exited properly, or has terminated due to an error, or maxed memory usage, etc.?

推荐答案

PHP脚本也可以使用PCNTL重新启动.

免责声明:本练习的目的仅在于证明PHP具有完全重新启动自身的能力并回答以下问题:

A PHP Script can also restart itself with PCNTL.

Disclaimer: the point of this exercise is only to prove that PHP is perfectly capable of restarting itself and to answer the question:

是否有一种方法可以在退出PHP脚本时自动重启它,而不管它是否已正确退出或由于错误而终止了?

Is there a way I can automatically restart a PHP script whenever it exits, regardless of whether it has been exited properly, or has terminated due to an error?

因此,我们不讨论有关Unix进程的任何详细信息,因此,我建议您从 PCNTL书或参考

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆