2016-02-18 118 views
0

我爲我的網站集成了PayPal自適應付款.Itz在本地完美工作。但是當我在實時服務器上嘗試它時,它顯示我有錯誤。我開始知道錯誤是由於curl SSL Connect錯誤。
任何人都可以幫助我嗎?Curl SSL Connect錯誤

$ch = curl_init(); 

    curl_setopt($ch, CURLOPT_URL, $this->apiUrl.$call); 

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); 

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); 

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE); 

    curl_setopt($ch, CURLOPT_TIMEOUT, 0); 

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

    curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers); 

    return json_decode(curl_exec($ch), TRUE); 

    print_r(json_decode(curl_exec($ch), TRUE)); 

    echo '<pre>';print_r(curl_getinfo($ch)); echo '</pre>'; echo '<br>'; 
+1

顯示什麼錯誤? –

+0

SSL連接錯誤 –

回答

0

嘗試使ssl驗證器如下所示爲false。它可能會幫助你。

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 

編輯

curl_setopt($ch, CURLOPT_USERPWD, $clientId.":".$secret); 
+0

我已經試過這個,不幸itz不工作.... –

+0

捲曲選項是否在你的服務器上工作? – PHPExpert

+0

儘量提供客戶端ID。我編輯了這個答案。 – PHPExpert