2014-11-27 1 views
0

페이지에 여러 개의 cURL 요청을하고 있습니다. 이 한 번의 POST 요청 후 내 cURL 출력에서이 오류가 발생합니다.PHP cURL에 따르면 https가 지원되지 않습니다.

* Protocol https not supported or disabled in libcurl 
* Closing connection -1 

cURL은 요청조차하지 않습니다. 이 오류를 해결하는 방법을 알아낼 수 없습니다.

이상한 점은 내 CLI와 FPM 모두에서 SSL이 활성화된다는 것입니다. 여기에 표시 http://cl.ly/image/1L062C2h2M2W

https : // 대신 http : //로 요청을 시도했습니다. 그것은 아무것도 바뀌지 않았습니다. 심지어 내 서버에 SSL이 있는지 확인하려고 시도했지만 변경되지 않았습니다.

내 컬 호출이

$fp2 = fopen('cookies/debug.txt', 'a'); 
fwrite($fp2, "\n $action"); 
fwrite($fp2, "\n $url"); 
fwrite($fp2, "\n ".sizeof($data)); 
fwrite($fp2, "\n ".json_encode($data)); 
fwrite($fp2, "\n_________________________________________\n"); 

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
if($action == "POST") curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_VERBOSE, 1); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
curl_setopt($ch, CURLOPT_USERAGENT, $agent); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 
curl_setopt($ch, CURLOPT_POSTREDIR, 3); 

$fp = fopen('cookies/curl.txt', 'a'); 
curl_setopt($ch, CURLOPT_STDERR, $fp); 

curl_setopt($ch, CURLOPT_COOKIEJAR, $this->strCookie); 
    curl_setopt($ch, CURLOPT_COOKIEFILE, $this->strCookie); 

    if($header) { 
     curl_setopt($ch,CURLOPT_HTTPHEADER,$header); 
    } 

// Set the request as a POST FIELD for curl. 
if($action == "POST") { 

    if(in_array("Content-Type:application/x-www-form-urlencoded", $header)) { 
     $data = http_build_query($data); 
    } 

    curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
} 

// Get response from the server. 
$res = curl_exec($ch); 
fwrite($fp, "\n_________________________________________\n"); 
fwrite($fp, "\n$action $url\n"); 

return $res; 

모습과 마지막 호출의 전체 디버그

______________about to try___________________________ 
POST https://sellercentral.amazon.com/gp/communication-manager/view-message.html/ref=ag_xx__cmread?ie=UTF8&addnFilter0=rs&arrivalDate=1417064517&clcmResponseTimeSuboptions=uwd&curPage=1&dateExactEnd=&dateExactStart=&dateFilter=7d&isInbox=1&itemsPerPage=20&marketplaceId=ATVPDKIKX0DER&messageId=A3OSG68VXPA9BV&msgIndex=1&otherPartyId=&pageNum=1&replyToEmail=0&searchBoxText=&showFilters=0&sortBy=ArrivalDate&sortOrder=Descending&timestamp=1417070427&totalMsg=1&view=reader 

* Protocol https not supported or disabled in libcurl 
* Closing connection -1 

입니다, 내 자신의 디버깅은 "시도에 대한". 이 요청을 시도 할 때 두 개의 **가 cURL의 유일한 출력입니다.

+0

로컬 호스트 또는 도메인에서 연결을 시도하고 있습니까? –

+0

랙 공간 서버에서 가져온 것임 –

+0

참고로이 도메인에 대한 https URL에 대한 다른 POST가 제대로 작동합니다. 그것은 특히이 하나입니다. 브라우저에서이 요청을 모니터링하면 302 Moved가 일시적으로 반환됩니다. 그건 내가 생각할 수있는 유일한 방법입니다. http://cl.ly/image/1l3k1w3s2s3v –

답변

1

"https"앞에 공백이 있습니다. 오류는 "https"가 지원되지 않는다고 말합니다.

관련 문제