curl: (28) Operation timed out after 2000 milliseconds with 0 bytes received
使用PHP的curl_init
<?php // create a new cURL resource $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "http://www.example.com/"); curl_setopt($ch, CURLOPT_HEADER, 0);
//数据传输的最大允许时间 curl_setopt($ch, CURLOPT_TIMEOUT, 1000); // grab URL and pass it to the browser curl_exec($ch); // close cURL resource, and free up system resources curl_close($ch);