1
페이스 북 그룹 용 크롤러를 구축하려고하는데이 점을 실행할 때 페이지 내용 얻을 : "SSL 인증서 problemq : 지역 발급자 인증서를 얻을 수 없습니다""SSL 인증서 문제 : 로컬 발급자 인증서를 가져올 수 없습니다."
<?php
$url = "https://www.facebook.com/groups/theGroupId/";
$ch = curl_init($url); // initialize the CURL library in my PHP script so we can later work on it - inside the handler.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // curl_setopt() function is used to set options on the $ch handler.// in this case we use the CURLOPT_RETURNTRANSFER option
$curl_scraped_page = curl_exec($ch); // "run all the stuff we've set" - return the data scraped to the variable $curl_scraped_page
var_dump($curl_scraped_page);
if ($curl_scraped_page === false) {
die(curl_error($ch));
}
curl_close($ch);
echo $curl_scraped_page;
?>
을 나는이 오류가 발생합니다. 이것은 정확
<?php
$url = "https://www.facebook.com/groups/{theGroupId}/";
$ch = curl_init($url); // initialize the CURL library in my PHP script so we can later work on it - inside the handler.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // curl_setopt() function is used to set options on the $ch handler.// in this case we use the CURLOPT_RETURNTRANSFER option
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "/CAcerts/GTECyberTrustGlobalRoot.crt");
$curl_scraped_page = curl_exec($ch); // "run all the stuff we've set" - return the data scraped to the variable $curl_scraped_page
var_dump($curl_scraped_page);
if ($curl_scraped_page === false) {
die(curl_error($ch));
}
curl_close($ch);
echo $curl_scraped_page;
?>
: 왜 이런 일, 2 개 가지 방법으로 그것을 해결하는 방법을 설명 http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/, 나는 모두를 시도했지만 여전히 같은 오류 메시지가 :
나는이 튜토리얼을 건너 실행 출력 (var_dump 포함) :내가 잘못하고 있나? 이것은 어쨌든 이것을하기위한 올바른 방법입니까?
1. 인증서를 무시하거나 2. 페이스 북 인증서 발급자를 식별 할 수있는 적절한 CA 인증서 파일을 사용하십시오 – DevZer0