2013-05-14 46 views
0

我试图创建一个简单的脚本,它将检索最后5进了一个Twitter用户(在这种情况下,英国广播公司)的file_get_contents()“未能打开流”错误检索鸣叫

这没关系运行在本地上我的开发服务器,但一旦我上传这活的网站,我收到以下错误:

Warning: file_get_contents(https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=bbc&count=5): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in .... 

有谁知道为什么这不我活的服务器上运行(而精我dev的服务器?)

回答

1

正如file_get_contents throws 400 Bad Request error PHP中提到的那样,使用curl inst file_get_contents的ead由于改进了错误处理 - 这可能会为您提供另一个线索。

+0

欢呼@celtis会给你一个去:) – Zabs 2013-05-14 13:02:53

+0

我试过这个,但只是得到一个NULL的返回值。有任何想法吗? http://phpfiddle.org/main/code/uuw-b5c – Zabs 2013-05-14 13:14:56

+0

首先,突出的是,您在'user_timeline.json'和'include_entities = true'之间缺少_?_。 – Celtis 2013-05-14 13:23:23

相关问题