即时执行并继续执行 php 脚本


Instant redicting and continue executing php script

当我使用 header() 时,在我的 srcipt 进行了精细执行后,我被判刑,对于 include 也是如此,即使我使用 html 并将我的 php 放在那里,iframe 在 php 完成后就可以工作了。

<?php 
header("Location: localhost/index.html");
sleep(120);
doSomethingUsefull();
?>

作为索引之前的 sain.html 是在 120 秒之后构建的。有没有其他方法可以包含某些内容,获取 redictet 并且我的脚本继续执行?

这个呢?

<?php 
    header("Location: localhost/index.html");
    session_write_close();
    fastcgi_finish_request();
    sleep(120);
    doSomethingUsefull();
?>