需求是在php文件接收接口,成功接收数据并返回客户端成功提示后,运行处理接收到的文件的程序。
接口函数。。。。。。
//接口返回数据,注意返回数据用echo,不要exit;
Response::show(200, '文件接收成功', $name);
//返回数据后去执行文件处理文件
if(function_exists('fastcgi_finish_request')){
ob_flush();
flush();//终止浏览器行为,回到后台继续运行
fastcgi_finish_request();
include_once('/var/xxx/xxx.php');//包含并在服务器端执行xxx.php文件
}
本文仅作备忘,以便自己后续使用。