// 你要跳转的url
$url = "http://www.baidu.com/";
 
// 如果使用的是php-fpm
if(function_exists('fastcgi_finish_request')){
    header("Location: $url");
    ob_flush();
    flush();
    fastcgi_finish_request();
// Apache ?
}else{
    header( 'Content-type: text/html; charset=utf-8' );
    if(function_exists('apache_setenv'))apache_setenv('no-gzip', '1');
    ini_set('zlib.output_compression', 0);
    ini_set('implicit_flush', 1);
    echo "<script>location='$url'</script>";
    ob_flush();
    flush();
}
 
    // 这里是模拟你的耗时逻辑
    sleep(33);

linux测试成功,windows不行

可处理的扩展 Gearman yii2-queue exec命令等 待研究

 

相关文章:

  • 2022-12-23
  • 2021-11-01
  • 2021-12-27
  • 2021-09-12
  • 2021-07-14
  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
相关资源
相似解决方案