我正在尝试从 soundcloud.com 抓取数据...但问题是它适用于 http...每当我输入 https url 时,页面是空白的并且没有结果,也没有错误
我有一个共享主机,我在其中配置了我的 php.inicurl.cainfo=/php/cacert.pem
我的卷曲代码看起来像这样......
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "/php/cacert.pem");
$contents = curl_exec($ch);
if($contents === FALSE) {
die(curl_error($ch));
}
curl_close($ch);
return $contents;
我已经从http://curl.haxx.se/docs/caextract.html下载了证书 并将它们复制到 myfolder/php...
请帮忙...