Php 尝试访问返回json的url会导致连接被对等错误重置

Php 尝试访问返回json的url会导致连接被对等错误重置,php,Php,我的php web应用程序正在尝试访问同一站点上返回json负载的另一个URL。我的web应用程序正在url上使用file_get_contents(),返回json,然后对其执行操作 我尝试使用curl而不是file_get_contents,但我遇到了相同的错误: A PHP Error was encountered Severity: Notice Message: file_get_contents(): send of 24 bytes failed with errno=104 C

我的php web应用程序正在尝试访问同一站点上返回json负载的另一个URL。我的web应用程序正在url上使用file_get_contents(),返回json,然后对其执行操作

我尝试使用curl而不是file_get_contents,但我遇到了相同的错误:

A PHP Error was encountered
Severity: Notice
Message: file_get_contents(): send of 24 bytes failed with errno=104 Connection reset by peer
Filename: xxxxxx.php
Line Number: 46

现在,这在以前的服务器上工作,我被告知,这个web应用程序是在某个共享主机上托管的

总之,当您访问url时,它会运行一些php,这些php会:

$foo = file_get_contents('http://example.com/twitter.json/?user_id=xxxxxx&count=500&include_rts=1&page=1&include_entities=5');
如果我在浏览器中访问,我会看到json,如果我尝试用php获取json,我会得到上面的错误

我简直想不出下一步该怎么办


感谢您的帮助

Twitter可能正在检查用户agenthee@barmar,但这并不能解释为什么它在以前的服务器上工作?一定是其他人会认为的,我只是想不出什么:(
$foo = file_get_contents('http://example.com/twitter.json/?user_id=xxxxxx&count=500&include_rts=1&page=1&include_entities=5');