+
80
-

使用paypal支付php代码报错- SSL certificate: unable to get local issuer certificate

php

今天用php开发paypal的时候,报错 SSL certificate: unable to get local issuer certificate

Fatal error: Uncaught PayPal\Exception\PayPalConnectionException: SSL certificate problem: unable to get local issuer certificate in \vendor\paypal\rest-api-sdk-php\lib\PayPal\Core\PayPalHttpConnection.php:186 Stack trace: #0 \vendor\paypal\rest-api-sdk-php\lib\PayPal\Auth\OAuthTokenCredential.php(252): PayPal\Core\PayPalHttpConnection->execute('grant_type=clie...') #1 \vendor\paypal\rest-api-sdk-php\lib\PayPal\Auth\OAuthTokenCredential.php(280): PayPal\Auth\OAuthTokenCredential->getToken(Array, 'ATnuSLiYPPpNovr...', 'EAadzJ40KVcpBan...', 'grant_type=clie...') #2 pay\vendor\paypal\rest-api-sdk-php\lib\PayPal\Auth\OAuthTokenCredential.php(216): PayPal\Auth\OAuthTokenCredential->generateAccessToken(Array, NULL) #3 \pay\vendor\paypal\rest-api-sdk-php\lib\PayPal\Auth\OAuthTokenCredential.php(166): PayPal\Auth\OAuthTokenCredential->updateAccessToken(Array) #4 D:\bfws in pay\vendor\paypal\rest-api-sdk-php\lib\PayPal\Core\PayPalHttpConnection.php on line 186


高手回复

+
0
-

可能本地没有根证书导致的,代码中设置一下:

<?php
curl_setopt($ch, CURLOPT_CAINFO, '/path/to/cacert.pem')


by ppzhuzhu
我知道答案,我要回答