微信超时5s,调用客服接口异步回复消息(PHP)

当用户触发事件,如果不能保证在5s内响应,可以先返回success,然后异步调用返回的信息。代码如下:

   // 立即返回(异步执行)
ignore_user_abort(true);//start=========
ob_start();
echo 'success'; // send the response
header('Connection: close');
header('Content-Length: ' . ob_get_length());
ob_end_flush();
ob_flush();
flush();//end===============
//以下为调用客服消息接口,回复用户消息的代码
上一篇:【CentOS】MySQL的安装


下一篇:Axis 1 https(SSL) client 证书验证错误ValidatorException workaround