dong
  • 1
  • 新人请关照

queryList CurlMulti 报错60

require_once DIR . '/../vendor/autoload.php';
use QLQueryList;
use QLExtCurlMulti;
$start = time();
$ql = QueryList::getInstance();
//or Custom function name
$ql->use(CurlMulti::class,'curlMulti');
$num = 1;
$ql->curlMulti([

'https://github.com/trending/php',
'https://github.com/trending/go'

])
// 每个任务成功完成调用此回调
->success(function (QueryList $ql,CurlMulti $curl,$r){

echo "Current url:{$r['info']['url']} \r\n";
$data = $ql->find('.p-name>a>em')->texts();
print_r($data->all());

})
// 每个任务失败回调
->error(function ($errorInfo,CurlMulti $curl){

echo "Current url:{$errorInfo['info']['url']} \r\n";
print_r($errorInfo['error']);

})
->start([

// 最大并发数
'maxThread' => 10,
// 错误重试次数
'maxTry' => 3,

]);

报错
Warning: Curl error(60) https://github.com/trending/php inC:\phpspider\queryList\vendor\ares333\php-curl\src\Curl.phpon line279

Warning: Curl error(60) https://github.com/trending/go inC:\phpspider\queryList\vendor\ares333\php-curl\src\Curl.phpon line279

阅读 97
评论 3月29日提问
    撰写回答

    登录后参与交流、获取后续更新提醒