getstream.io SSL 证书无法获取本地颁发者证书

getstream.io SSL certificate unable to get local issuer certificate

我需要一些帮助。我正在将 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 的以下说明

  1. 将 get-stream 添加到您的作曲家中:

    "require": { "get-stream/stream-laravel": "~2.1" },

  2. 然后 运行 作曲家更新

  3. 我还添加了提供商和别名

    'providers' => 数组( 'GetStream\StreamLaravel\StreamLaravelServiceProvider', ... ),

    'aliases' => 数组( 'FeedManager' => 'GetStream\StreamLaravel\Facades\FeedManager', ... ),

  4. 我运行:

    php artisan vendor:publish --provider="GetStream\StreamLaravel\StreamLaravelServiceProvider"

  5. 我已经发邮件给 getstream.io,但还没有回复。当我收到他们的一些答复时,我会更新这个post。

我也从 laracast 查看了这个 post,但是没有答案。 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

这就是我所做的:

  1. 在curl.haxx.se/ca/cacert.pem从上面的link下载cacert.pem并保存到c:/wamp/bin/php/php5。 5.12/证书/

  2. 单击我的 wamp 图标,导航至 PHP > php.ini

  3. 添加了以下行并单击保存。

    curl.cainfo=c:/wamp/bin/php/php5.5.12/cert/cacert.pem

  4. 重新启动 wamp,就是这样。有效

希望这对使用 getstream.io 的其他开发人员有所帮助。归功于 getstream.io.

的 Tommaso