慕慕森
尝试通过 curl 调用页面,例如:$curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url);curl_setopt ($curl, CURLOPT_POST, FALSE);curl_setopt($curl, CURLOPT_TIMEOUT, 1); curl_setopt($curl, CURLOPT_HEADER, 0);curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);curl_setopt($curl, CURLOPT_FORBID_REUSE, true);curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1);curl_setopt($curl, CURLOPT_DNS_CACHE_TIMEOUT, 10); curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);curl_exec($curl); curl_close($curl); 它调用 url 并立即使其超时。然后在你昂贵的脚本中:header("Connection: close\r\n");header("Content-Encoding: none\r\n");header("Content-Length: 1");ignore_user_abort(true);//your code