我需要一些帮助。我正在将 getstream.io 集成到我的 laravel 应用程序 (v5.1) 中,但遇到了此错误:
cURL error 60: SSL certificate problem: unable to get local issuer certificate
这是我的代码:
use GetStream\Stream\Client;
public function index()
{
$client = new Client('rrzp7mz8htgn', '8cgs94jg2z5da2h4q2an8q6q5vktrp8y8w7rsft3zndf63c8y9n59g2h2qvtdhqq');
$ericFeed = $client->feed('user', 'eric');
$data = [
"actor"=>"eric",
"verb"=>"like",
"object"=>"3",
"tweet"=>"Hello world"
];
$ericFeed->addActivity($data);
}
我按照 packalyst 的以下说明进行操作
将 get-stream 添加到您的 Composer 中:
“要求”:{ “get-stream/stream-laravel”:“~2.1” },
然后运行composer update
我还添加了提供程序和别名
'提供商' => 数组( 'GetStream\StreamLaravel\StreamLaravelServiceProvider', ... ),
'别名' => 数组( 'FeedManager' => 'GetStream\StreamLaravel\Facades\FeedManager', ... ),
我跑:
php artisan 供应商:publish --provider="GetStream\StreamLaravel\StreamLaravelServiceProvider"
我已经通过电子邮件发送给 getstream.io,但尚未回复。当我收到他们的一些答复时,我会更新这篇文章。
我也检查了 laracast 的这篇文章,但没有答案。 https://laracasts.com/discuss/channels/general-discussion/activity-feeds-with-getstreamio?page=0
最佳答案
Getstream.io 回复了我的电子邮件并为我提供了帮助,这是解决方案,
the SSL error message it’s usually related to using old certificate key chains with CURL. This is unfortunately quite of a common issue with CURL and SSL, I suggest you to try the solution suggested in this thread: Paypal Access - SSL certificate: unable to get local issuer certificate
这就是我所做的:
从上面的链接curl.haxx.se/ca/cacert.pem下载cacert.pem并将其保存到c:/wamp/bin/php/php5.5.12/cert/
里>单击我的 wamp 图标,导航至 PHP > php.ini
添加以下行并单击“保存”。
curl.cainfo=c:/wamp/bin/php/php5.5.12/cert/cacert.pem
重新启动 wamp 就可以了。成功了
希望这可以帮助其他使用 getstream.io 的开发人员。感谢 getstream.io 的 Tommaso。
关于ssl-certificate - getstream.io SSL 证书无法获取本地颁发者证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33958930/