且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP后台进程

更新时间:2023-02-22 21:03:10

好,您可以使用"

Well, you can use "ignore_user_abort(true)"

因此脚本将继续起作用(注意脚本的持续时间,也许添加" set_time_limit (0))

So the script will continue to work (keep an eye on script duration, perhaps add "set_time_limit(0)")

但是这里有个警告:您将无法通过以下两行来停止脚本:

But a warning here: You will not be able to stop a script with these two lines:

ignore_user_abort(true); 
set_time_limit(0);

除非您可以直接访问服务器并杀死那里的进程! (在那儿,进行了无休止的循环,一次又一次地调用自己,使服务器急停下来,大喊大叫……)

Except you can directly access the server and kill the process there! (Been there, done an endless loop, calling itself over and over again, made the server come to a screeching stop, got shouted at...)