首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >连接到getstream php时出错

连接到getstream php时出错
EN

Stack Overflow用户
提问于 2016-09-23 23:55:13
回答 3查看 721关注 0票数 4

我正在started/?language=php上学习这个示例,以了解getstream是如何工作的。我遇到了一个让我困惑的错误。

代码语言:javascript
复制
 require_once './vendor/autoload.php';
 $client = new GetStream\Stream\Client('YOUR_API_KEY',     'API_KEY_SECRET');
$chris = $client->feed('user', 'chris');
 // I replaced Your api key and api key secret with the one         in my dashboard
// Add an activity; message is a custom field - tip: add unlimited         custom fields!
$data = array(
"actor" => "chris",
"verb" => "add",
"object" => "picture:10",
"foreign_id" => "picture:10",
"message" => "Beautiful bird. Absolutely beautiful. Phenomenal bird."
);

$chris->addActivity($data);


// jack's 'timeline' feed follows chris' 'user' feed:
$jack = $client->feed('timeline', 'jack');
$jack->followFeed('user', 'chris');


// Read the 'timeline' feed for jack, chris' post will now show up: 
$activities = $jack->getActivities(10);
var_dump($activities);

在我的composer.json文件中我做了这个

代码语言:javascript
复制
       "require": {
        "get-stream/stream": "2.2.8"
        }

我在windows的本地主机上尝试了上面的代码,但是得到了这个错误。

代码语言:javascript
复制
Fatal error: Uncaught exception 'GuzzleHttp\ExceptionConnectException'     with message 'cURL error 28: Operation timed out after 0 milliseconds with 0 out of 0 bytes received (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\xampp\htdocs\CorpersMate\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 186
 GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 0 milliseconds with 0 out of 0 bytes received (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in C:\xampp\htdocs\CorpersMate\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 186

伙计们有什么想法吗?

EN

Stack Overflow用户

发布于 2016-09-24 01:31:01

你应该提供指导-我们必须先注册才能得到它,这是不可能的。

将第二行改为

代码语言:javascript
复制
$client = new GetStream\Stream\Client(KEY, SECRET);
票数 1
EN
查看全部 3 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39671102

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档